8
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

macOS Mojaveにpyenv-virtualenv環境構築

Last updated at Posted at 2019-01-06

初めに

macOS Mojaveにpyenv-virtualenv (python 3.6.7)の構築で一手間あったためのメモ

関連packages

$ brew update
$ brew install zlib

pyenv, pyenv-virtualenv

$ brew install pyenv
$ brew install pyenv-virtualenv

pyenv用 Profile

$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile

python

$ pyenv install 3.6.7
$ pyenv rehash

# 確認
$ pyenv versions
* system (set by /Users/xxxx/.pyenv/version)
  3.6.7

インストールに失敗する場合は下記を実施

$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

MojaveにはmacOS SDK headerが入っていない事が原因

pyenv-virtualenv環境構築

$ pyenv virtualenv 3.6.7 pvenv3.6.7

# 確認
$ pyenv versions
* system (set by /Users/xxxx/.pyenv/version)
  3.6.7
  3.6.7/envs/pvenv3.6.7
  pvenv3.6.7

local設定(pvenv3.6.7 )

$ pyenv local pvenv3.6.7

# 確認
$ python -V
Python 3.6.7

$ cat .python-version	
pvenv3.6.7

参考

https://qiita.com/niwak2/items/5490607be32202ce1314
https://qiita.com/1000ch/items/93841f76ea52551b6a97
https://qiita.com/zreactor/items/c3fd04417e0d61af0afe

8
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?