1👍
Since you are putting the Python 3.4 bin
directory at the end of your PATH
, running python
in Terminal is resulting in /usr/bin/python
being called, which is the system version 2.6. Try just running python
and you’ll see.
To fix it, set your PATH
up like so:
export PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin/:/Library/Frameworks/Python.framework/Versions/3.4/bin/:/usr/bin:/usr/sbin:/bin:/usr/local/bin:/sbin:/opt/x11/bin:$PATH
2.7/bin
contains a python
executable, while 3.4/bin
should also contain a python3
executable. Now, when you run python
from the command prompt, the Python.org version of Python 2.7 will start up, and if you run python3
then version 3.4 will start. Download get-pip.py
from here, then run it using python3
. Depending on your system configuration, you may need to prefix the command with sudo
(i.e., sudo python3 get-pip.py
).
Python 3.4 already comes with venv
, so you should be able to run pyvenv /path/to/virtual_env
to set up a virtual environment.