开发者

Problems on Python upgrade on OS X

I have OS X 10.6.6 Snow Leopard. The OS X default install of python is 2.6.1 in 64 bit mode. Apple nicely installs several python extensions such as numpy and several frameworks for Apple Events.

Most do not recommend upgrading the default Perl on OS X since the OS relies on certain behaviors of Perl at the time of release. Python community seems more optimis开发者_StackOverflow中文版tic and recommends:

The overwhelming recommendation of the "MacPython" community is to upgrade your Python by downloading and installing a newer version from the Python standard release page

I have done two attempts at upgrades. The first attempt was to install Python 2.7.1 through MacPorts. The second was just a straight download of Python 2.7.1 from the Python standard release page.

Facts:

  1. The MacPorts version is installed in /opt/local/bin/python with frameworks in /opt
  2. The default OS X python 2.6.1 and 2.5.4 remain at /usr/bin
  3. /System/Library/Frameworks/Python.framework has frameworks for python v 2.3, 2.5, 2.6 and "Current". "Current" is empty.
  4. The download from the python website is installed at /usr/local/bin and is a link to /Library/Frameworks/Python.framework/Versions 2.7
  5. My path is set so the MacPorts version is first in the path.

Questions and problems:

  1. The MacPorts version cannot run pydocs -g. It fails with the error: TclError: out of stack space (infinite loop?) I have tried to download macports version of Tkinter but still no joy. Ideas?
  2. Can I migrate over the Apple installed python support modules or do I need to manually reinstall each one?
  3. Can I delete the python 2.3 framework in /System/Library/Frameworks/Python.framework? There does not seem to be a link to these executables in the /usr/bin directory.
  4. If the recommendation of the "MacPython" community is to "upgrade" why does the system version remain untouched by the python download of 2.7.1?
  5. Once I figure out all these versions, what is 'best practice' on sharing modules between different versions of python that are installed?


1. The MacPorts version cannot run pydocs -g. It fails with the error: TclError: out of stack space (infinite loop?) I have tried to download macports version of Tkinter but still no joy. Ideas?

I'm not a user of MacPorts, so I don't have any thoughts on this item.

2. Can I migrate over the Apple installed python support modules or do I need to manually reinstall each one?

Manually reinstall each one. I'd recommend installing these in one or more virtualenv environments so as to not pollute your global site-packages directories.

3. Can I delete the python 2.3 framework in /System/Library/Frameworks/Python.framework? There does not seem to be a link to these executables in the /usr/bin directory.

I wouldn't delete anything in /System/Library/Frameworks/. As stated by Alex Martelli in his answer to this SO question, "You should not tamper in any way with the system-supplied Python."

4. If the recommendation of the "MacPython" community is to "upgrade" why does the system version remain untouched by the python download of 2.7.1?

While they use the word "upgrade", they really mean to perform a completely new install and not use/touch the Apple installed version.

5. Once I figure out all these versions, what is 'best practice' on sharing modules between different versions of python that are installed?

virtualenv

For info on how I've installed Python and various packages, check out the following StackOverflow questions:

  • What's the proper way to install pip, virtualenv, and distribute for Python?
  • Why should I install Python packages into ~/.local?

Using the Python.org DMGs will perform Python Framework installs located in /Library/Frameworks/Python.framework/.


the only place I've found with the answer: Follow the sheep blog

All credits to Follow The Sheep for this great answer to question #1 re: MacPorts & TCL threading...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜