Environment construction of python2 & 3 (OSX)

Python construction notes for yourself. I will write it on the assumption that homebrew is included. For the time being, I will do my best with the following procedure.

$ brew install pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ exec $SHELL
$ pyenv install 2.7.9
$ pyenv install 3.4.3
$ pyenv global 2.7.9 3.4.3

Once you've done this, the rest is as follows ...

$ python --version
Python 2.7.9
$ python2 --version
Python 2.7.9
$ python3 --version
Python 3.4.3

And you can do this.

$ pip --version
pip 6.1.1 from /Users/mypc/.pyenv/versions/2.7.9/lib/python2.7/site-packages (python 2.7)
$ pip2 --version
pip 6.1.1 from /Users/mypc/.pyenv/versions/2.7.9/lib/python2.7/site-packages (python 2.7)
$ pip3 --version
pip 6.0.8 from /Users/mypc/.pyenv/versions/3.4.3/lib/python3.4/site-packages (python 3.4)

With this, pip can be used properly according to the version of python.

Recommended Posts

Environment construction of python2 & 3 (OSX)
Environment construction (python)
Python --Environment construction
Python environment construction
python environment construction
Environment construction of python and opencv
Environment construction of python3.8 on mac
Unification of Python environment
python windows environment construction
homebrew python environment construction
Python development environment construction
python2.7 development environment construction
Mac environment construction Python
Python environment construction @ Win7
Installation of Python3 and Flask [Environment construction summary]
Python + Anaconda + Pycharm environment construction
Python environment construction (Windows10 + Emacs)
[Memo] Construction of cygwin environment
Python environment construction For Mac
Python3 environment construction (for beginners)
Python environment construction and TensorFlow
Python environment construction under Windows7 environment
Python environment construction memo on Windows 10
Anaconda python environment construction on Windows 10
Start of self-made OS 1. Environment construction
Python + Unity Reinforcement learning environment construction
Kivy + Python3 on OSX environment maintenance
[Django] Memorandum of environment construction procedure
I checked Mac Python environment construction
Python environment construction memo on Mac
Python environment construction (pyenv, anaconda, tensorflow)
[Python3] Development environment construction << Windows edition >>
Environment construction memo of pyenv + conda
Python development environment construction on macOS
Python environment construction (pyenv + poetry + pipx)
Python3 environment construction with pyenv-virtualenv (CentOS 7.3)
Python3 TensorFlow for Mac environment construction
pytorch @ python3.8 environment construction with pipenv
[docker] python3.5 + numpy + matplotlib environment construction
Environment construction of "Tello_Video" on Ubuntu
Python3.6 environment construction (using Win environment Anaconda)
OpenCV3 & Python3 environment construction on Ubuntu
Construction of Python local development environment Part 2 (pyenv-virtualenv, pip usage)
Automatic scraping of reCAPTCHA site every day (1/7: python environment construction)
Memo of python + numpy/scipy/pandas/matplotlib/jupyterlab environment construction on M1 macOS (as of 2020/12/24)
Django environment construction
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
Introduction of Python
Python (anaconda) development environment construction procedure (SpringToolsSuites) _2020.4
DeepIE3D environment construction
Emacs-based environment construction
Linux environment construction
Python project environment construction procedure (for windows)
python environment settings
Construction of Python local development environment Part 1 (pyenv, pyenv-virtualenv, pip installation)
python windows environment
About the virtual environment of python version 3.7
[Python] Road to snake charmer (1) Environment construction
Python3 + venv + VSCode + macOS development environment construction
Basics of Python ①
Basics of python ①