This post is based on the assumption that Python + pyenv + virutalenv is installed. If you haven't installed the above, please refer to the post below.
Python, which is included as standard in the OS, is provided for the libraries and applications included in the OS. Therefore, if you use it for free programming, you run the risk of problems with the apps and libraries it depends on. To avoid the above, it is better to create a virtual environment when programming.
The environment is Mac OSX 10.10.5, and it is assumed that Xcode and homebrew are installed.
First, check if the path is in Python under pyenv.
$ pyenv which python
$ pyenv which pip
It is OK if you can execute the above command and confirm that Python and pip are under .pyenv.
Execute by specifying the Python version and virtual environment name.
$ pyenv virtualenv 3.5.2 test_3.5.2
First, create a directory on virtualenv. You can create the directory anywhere.
$ mkdir ~/Documents/test_project
Navigate to the directory you created.
$ cd ~/Documents/test_project
Associate the virtual environment of virtualenv with the directory.
$ pyenv local test_3.5.2
The virtual environment built with virtualenv can be deleted below.
$ pyenv uninstall test_3.5.2
If you have any questions or mistakes, please comment. I hope that what my friends have taught me will help more people.
Recommended Posts