Install Python 3.3 on Mac

I used the installer from http://www.python.org/download . The installation was successful, and it fell into the Python 3.3 folder in my application directory. I ran the “Update Shell Profile.command” script that it contained, and it added /Library/Frameworks/Python.framework/Versions/3.3/to my path. However, the version Pythonin this directory looks like 2.7.5.

/Library/Frameworks/Python.framework/Versions/3.3  ls
Headers   Python    Resources bin       include   lib       share
/Library/Frameworks/Python.framework/Versions/3.3  Python --version
Python 2.7.5

Also ls /usr/bin | grep pythonshows:

python
python-config
python2.5
python2.5-config
python2.6
python2.6-config
python2.7
python2.7-config
pythonw
pythonw2.5
pythonw2.6
pythonw2.7

What did I miss?

+3
source share
2 answers

There are several issues here.


Firstly, you should not run the Pythonframework executable. Framework executables are not meant to be run, and it really is only a coincidence that this is happening.

, , bin - - (, /usr/local/bin) (, /Library/Frameworks/Foo.framework/Versions/X.Y/bin). Python 3.3 .

bin , , Python .


, Mac , Windows, PATH. , Python --version, Python - PATH. , , ( , ). ( , ), ./Python.


, cd framework. , , , : bin/python3, , .


, , , , Python 3.3. Update Shell Profile.command script Python 3.3 PATH PATH, - . , .


:

ls /usr/bin | grep python :

/usr/bin , . , , /usr/local/bin - PATH. Python ( , ...), /usr/local/bin. , , bin PATH. /usr/bin.


, , Python 3.3 Python 2.7. python3 python3.3 3,3, Python python2.7 2,7. . PEP 394 - "python" Unix- . , Python 2.7 3.3, , , .


, :

  • Terminal.app.
  • python3 --version.
+4

virtualenv:

$ /Library/Frameworks/Python.framework/Versions/3.3/bin/python3 -m venv ~/myvenv
$ source ~/myvenv/bin/activate
(myvenv) $ curl https://bootstrap.pypa.io/get-pip.py | python
(myvenv) $ deactivate
$ source ~/myvenv/bin/activate

http://docs.python-guide.org/en/latest/dev/virtualenvs/

0

All Articles