![]() So with the modified path as above you should see the following behaviors: $ /Library/Frameworks/amework/Versions/2.7/bin/python2.7 -c 'import sys print(sys.version)'Ģ.7.1 (r271:86882M, Nov 30 2010, 09:39:13) One thing to keep in mind is that you can always use an absolute path to the desired python command to check. There are many ways to manage multiple Python installations on OS X check the archives or the web. usr/bin/pydoc* /usr/bin/python-config* in general, you should not attempt to modify or delete files in /usr/bin since they are part of OS X and managed by Apple.) When you type python as a command in the shell, that symlink will be found first before the Apple-supplied python in /usr/bin one of the directories where system-supplied user commands are installed (as on OS X 10.6): $ ls /usr/bin/py* Library/Frameworks/amework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin Because the PATH environment has been changed: $ echo $PATH The new python is available as the command python2.7 but there is also a symbolic link to it as python. Lrwxr-xr-x 1 root admin 16 Nov 30 00:49 -> python2.7-config Lrwxr-xr-x 1 root admin 9 Nov 30 00:49 -> python2.7 Lrwxr-xr-x 1 root admin 8 Nov 30 00:49 -> pydoc2.7 If you take a look in that directory, you should see something like this: $ ls -l /Library/Frameworks/amework/Versions/2.7/bin PATH="/Library/Frameworks/amework/Versions/2.7/bin:$" This should result in something like this: $ cat ~/.bash_profile By default, the installer runs the Update Shell mand for you automatically. Its purpose is to modify the startup files for the most common shell programs on OS X ( bash, sh, csh) to ensure that the directory where the new Python's executable commands are located gets added to the front of the list of directories in the PATH environment variable, so that the python commands in it will be found before the Apple-suppled python commands are found. It's a shell script you can inspect it in an editor or with Quicklook. If you look in /Applications/Python 2.7, you'll see a file called Update Shell mand. (You will need to start a new terminal session after running the installer to see this.) The current installers for OS X create a folder in your Applications directory named Python m.n depending on the Python version. ![]() If you did not change the default set of packages when using the installer, typing python from a command line should run the newly-installed Python 2.7. Therefore I want to gain clear insights to my questions above. TrashMe or AppCleaner might not be very effective with uninstalling Python if ever I want to go back to a clean slate. Python is quite a complicated installation, writing files to different folders and configuring OS settings like PATH. I might as well try these out myself first, but I'm new to the Mac. For Mac OS X, how do I tinker with the PATH? I know how to do this in Windows (Environment Variables). What are these talk about setting the PATH when installing a different Python version? I understand that the Python installer will just set it up automatically.In Terminal, how do I specify to run the Apple-supplied Python? What about the Python I installed myself?.If I type python in Terminal, which one will I get?.If I just run the mpkg installer inside the DMG, accepting all defaults, will it live peacefully with the Apple-supplied Python?.I have seen suggestions to get ActivePython, but I would prefer the one from. I have just downloaded the Python 2.7.1 DMG from.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |