osx - Installing Python 3.3 on mac -
I installed the installer from the install succeeded, and I left Python 3.3 folder in my application directory. I had included it in the "Update Shell Profile Dotmanned" script, and in my way it was prepared for / libraries / framework / Python.framework / version / 3/3 /
. However the version appears to be Python
version 2.7.5 in that directory.
/ library / framework / python Libre Share / Library / Framework / Python in Framework / Version / 3.3 ls Header Python Resource Bin. Framework / Version / 3.3 Python - version Python 2.7.5
In addition, ls / usr / bin | Grep Python
Shows:
Python Python-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?
There are many problems here.
First of all, you should not run the Python
, the executable framework of the frame is not executable, and it is actually only a coincidence that it is a To work is done.
To run the framework with the programs, run them in a bin
directory somewhere - either outside the framework (such as / usr / local / bin
) Or inside it (such as /Library/Frameworks/Foo.framework/Versions/XY/bin
). By default, Python 3.3 does the latter.
And the programs inside the bin
directory have been reduced to all, not capitalized, so there is no Python
.
On the next, on Mac, and on Windows, on almost every other platform in the world, the current working directory is not part of your PATH
. Therefore, when you type Python --version
, then finds Python
anywhere at PATH
. There is nothing meaning in the current directory about the fact that the name is executable (except that it is misleading to you). If you really want to run that file (but again, you really do not), you have to type ./ Python
instead.
In addition, there is not really good reason for the CD
in the framework directory at first place. Of course, you can be that From the file you want to run, with the appropriate relative path name: bin / python3
, for example, but you do not want to.
Next, chances are that you are already using a shell running before installing Python 3.3. Use the Update Shell Profile. Com menu
to add Python 3.3 to all future shells or that PATH
, but by any means do it any existing will not affect the shell, to solve it, you just have to start a new shell.
Next:
ls / usr / bin | Grep Python
Shows:
/ usr / bin
directory is only for programs that are part of the OS Programs you have installed < Code> / usr / local / bin>, or somewhere else on your path, instead the Python installer has an option (though it can be hidden, I do not remember ...) < Code> / usr / local / bin to insert the launcher. And it also has an option - which you have chosen - put your bin
directory on your PATH
. But by any means, it can never put anything in / usr / bin
.
And finally, even after installing Python 3.3, the default dragon
will still be 2.7 python3
and < Code> python3.3 will be 3.3, but for the logic of dragon
and python2.7
2.7 will be seen, but the short version is that all types of code Which depends on Python 2.7 and is not compatible with 3.3 which may be installed on your system, and you do not want to stop doing all this work.
So, by putting it together:
- Create a new tab or window in the terminal.app.
- Type
python3 --version
.
Comments
Post a Comment