Mac OS X, Python, and Fink: Playing Nicely Together
Since upgrading to Leopard, I've been using Mac's default install of python (which is 2.5.1). For the most part it's worked well for me, namely because I've installed additionaly packages either using Mac installers or through easy_install. I recently needed to install python-ldap which didn't work using easy_install. So, I turned to Fink .
Unfortunately, Fink wanted to install it's own version of python (2.5.2) as well. (I say unfortunately only because I now how two separate python installations, which I think is a bit redundant.) So, the problem is this: How do I make the Mac's System python play nicely with any python modules I install through Fink?
My solution to this problem is to add the Fink python's site-packages directory to my PYTHONPATH. I do this by setting an environment variable in my .profile file located in my home directory. I added the following:
Now, when I run the python interpreter, I can import packages that were installed the Mac way, or through Fink. Hopefully, this won't give me any problems.
本文开发（python）相关术语:python基础教程 python多线程 web开发工程师 软件开发工程师 软件开发流程
本文标题：Mac OS X, Python, and Fink: Playing Nicely Together