开发者

Curious about python installation paths, especially on OSX

开发者 https://www.devze.com 2022-12-29 05:11 出处:网络
First:I\'m running Macports.No problems with that, except: /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin

First: I'm running Macports. No problems with that, except:

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin

which is the value of sys.exec_prefix, for my macports python even though:

/opt/local/lib/python2.6/site-packages/ 

seems to be quite a logical place to put things, /opt/local being the macports --prefix, as it were. Why does easy_install put things in this odd Frameworks/Python.fram开发者_运维知识库ework thing?

More importantly, can i use the methods here, to ensure that all my systemwide python, particularly the scripts which I really want in /opt/local/bin, things I use all over the place like (i|b)python for example are accessible?


So first I'd make the observation that the directory

/Library/Frameworks/Python.framework/Versions/2.6/...

is where you can find the OS X provided version of Python so I'd guess that what the MacPorts developers want to do is replicate the OS X Python directory structure but keep it as far away from the OS X version of Python as possible. Also I think replicating the structure allows you to install third-party extensions outside of the MacPorts modules. I've done that before so I know it's possible, its just you still need to make sure:

  1. When installing the modules, the version that the installer encounters when doing a PATH search is the Python installation you want to install it to (ie. a module meant for MacPorts Python doesn't end up in OS X Python). The page you cited earlier spells out the procedure an installer goes through when trying to find a Python installation to install to so you have some hints there about what to look into if you have problems installing third party modules.
  2. Once you have installed your modules you'll have to keep track of them yourself because MacPorts won't do that for you. On the bright side everything should be in the site-extensions folder of the Python installation, I think.

This question from the MacPorts FAQ kind of lays the groundwork for their philosophy of directory organization I think. Also this question too.

0

精彩评论

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

关注公众号