Using multiple versions of Python on Mac OS X (1) Multiple Ver installation

Python installation material. I have re-installed the Python environment on Mac OS X Mavericks, so I will summarize it.

About installation method

There are tools such as pyenv and pythonz for inserting multiple versions of Python, but sometimes everyone loves Homebrew if it is good to use 2.7x series and 3.x series, which are the two major trends of Python. I'm wondering if there is.

brew install python
brew install python3

This will install the latest version of python 2.x series and 3.x series respectively. You can check which python is installed successfully.

[~] which python3                                            
/usr/local/bin/python3 ← Path entered by homebrew

[~] which python
/usr/bin/python ← something different

Some people will do both well, while others will be like the above. In this case, python is not the 2.x installed by homebrew, but the one installed by default on the Mac.

The cause is that usr / bin is described before usr / local / bin in the PATH setting and has priority.

[~] vim /etc/paths

/usr/local/bin ←/usr/Described above bin
/usr/bin
/bin
/usr/sbin
/sbin
:

Let's modify the PATH directly and start the terminal.

[~] which python
/usr/local/bin/python

Now you can see that the python 2.x series also uses the one installed via homebrew.

Next time based on this Python Using multiple versions of Python on Mac OS X (2) Usage Now, let's create the environment actually used for development using virtualenv.

Recommended Posts

Using multiple versions of Python on Mac OS X (1) Multiple Ver installation
Installation of scikit-learn (Mac OS X)
How to build an environment for using multiple versions of Python on Mac
Using NAOqi 2.4.2 Python SDK on Mac OS X El Capitan
Run Zookeeper x python (kazoo) on Mac OS X
Shpinx (Python documentation builder) on Mac OS X
Try using E-Cell 4 on Windows 7 or Mac OS X
Install multiple versions of Python
Handling of python on mac
Build a Python development environment on Mac OS X
Memo on Mac OS X
Easy on Mac! Plot of unit step response using Python
Install Sphinx on Mac OS X
Install mitmproxy on Mac OS X
Environment construction of python3.8 on mac
If Python 3.5.0 installation fails on Mac
Install pgmagick on Mac OS X 10.9
Get started with the Python framework Django on Mac OS X
Continuation ・ Notes on preparing the Python development environment on Mac OS X
Install lp_solve on Mac OS X and call it with python.
How to install Theano on Mac OS X 10.10 (using pyenv, anaconda)
Installed aws-cli On Mac OS X Lion
How to erase Python 2.x on Mac.
Install multiple versions of Polyphony using venv
Study on Tokyo Rent Using Python (3-1 of 3)
Video processing using Python + OpenCV on Mac
Run NASA CEA on Mac OS X
Notes on setting pyenv and python environment using Homebrew on Mac OS Marvericks
I tried putting various versions of Python + OpenCV + FFmpeg environment on Mac
python on mac
Use multiple versions of python environment with pyenv
Put Python 2.7.x on Mac OSX 10.15.5 with pyenv
I installed Pygame with Python 3.5.1 in the environment of pyenv on OS X
When import tkinter is not possible on Mac OS X 10.11.3 (El Capitan) + pyenv + Python 3.5.1.
Preparing to use aws cli on Mac OS X
Set up a file server using samba on ZeroPi of Friendly Arm [OS installation]
Building an environment for "Tello_Video" on Mac OS X
Build a machine learning Python environment on Mac OS
Very easy to install SciPy on Mac OS X
Install Python on Mac
Install Python 3 on Mac
[Is it explosive !?] Setup for using the GPU version of Tensorflow on OS X
numba installation on mac
Installation of Python 3.3 rc1
Build a Python environment on your Mac using pyenv
mac OS X 10.15.x pyenv Python If you can't install
Install PyQt5 with homebrew on Mac OS X Marvericks (10.9.2)
Install Python 3.4 on Mac
Minimum memo when using Python on Mac (pyenv edition)
Steps to use the AWS command line interface (Python / awscli) on Mac OS X
Installation of matplotlib (Python 3.3.2)
Create a Python development environment on OS X Lion
pangolin x python x mac os build failed memorandum unsolved
Minimum notes when using Python on Mac (Homebrew edition)
Word Count with Apache Spark and python (Mac OS X)
Building a Python environment on a Mac and using Jupyter lab
Test Python with Miniconda on OS X and Linux with travis-ci
Switch versions when multiple versions of java are included on Linux
[Python] PyCharm environment settings (installation, interpreter settings, addition of packages) Mac environment
How to install Theano on Mac OS X with homebrew
Initial setting of Mac ~ Python (pyenv) installation is the fastest