http://qiita.com/shizuma/items/027167c6257f1c9d2a6f
One command.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install pyenv
$ brew install pyenv-virtualenv
PYENV_ROOT=~/.pyenv
export PATH=$PATH:$PYENV_ROOT/bin
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Reflected.
source ~/.bash_profile
There are various pythons that can be installed with this command
$ pyenv install --list
From this, I want to use Python2 system, so I will put the latest of anaconda2
$ pyenv install anaconda2-4.2.0
Check the python currently specified by pyenv
$ pyenv versions
* system (set by /Users/nakazonor/.pyenv/version)
anaconda2-4.2.0
Python with the master now specified system is probably Python that comes in from the beginning
Then, specify the installed anaconda with the following command
$ pyenv global anaconda2-4.2.0
With this, Anaconda of Python2 series is specified. Since it's a big deal, let's add Python 3 system
$ pyenv install anaconda3-4.2.0
Also, if you specify anaconda3 in pyenv global, it becomes Python3.
$ pyenv global anaconda3-4.2.0
Make a directory
$ mkdir study-conda
It seems that you should specify the installed Python version and project name like this
$ pyenv virtualenv anaconda2-4.2.0 study-conda
In the directory you just created
$ pyenv local study-conda
Then, when you enter the study-conda directory after that, the study-conda environment specified in virturalenv will be automatically set. (In short, if you put the package with pip or conda in this, it will not pollute other environments)
By the way
$ pyenv local --unset
You can cancel the local setting with.
↓ If you want to delete virtualenv, this is OK
$ pyenv uninstall study-conda
$ pip install numpy
$ pip list
numpy (1.11.3)
pip (9.0.1)
setuptools (27.2.0)
wheel (0.29.0)
You got numpy.
This time, when I go through the study-conda directory and pip list ... It's full of things, but I think it's probably because I put it in anaconda.
$ cd ..
$ pip list
alabaster (0.7.9)
anaconda-clean (1.0)
anaconda-client (1.5.1)
anaconda-navigator (1.3.1)
appnope (0.1.0)
appscript (1.0.1)
argcomplete (1.0.0)
astroid (1.4.7)
astropy (1.2.1)
Babel (2.3.4)
・
・
・
Well, anyway, I succeeded in separating the environment for each directory.
Next, I would like to be able to debug using VSCODE.
Recommended Posts