开发者

Install BeautifulSoup for another Python version on Mac OS X

I have three versions of Python on my Mac: 2.6.1 (built-in), 2.5.4 (Google App Engine development), and 2.7.2 (general Python programming).

I installed BeautifulSoup with python setup.py i开发者_Go百科nstall. However, only 2.7.2 is able to work with it.

How do I install it for 2.5.4 as well?


/path/to/other/python setup.py install

It can be helpful to make aliases for your various system Pythons (e.g. python25, and so on) in your .bashrc.

In regards to changing what python points to from the default system Python, I know that this will work if you alias to a newer version, but it may cause issues with an older version, so be careful (just my $.02).


Set your PYTHONPATH environmental variable to point to the installation you want to install it for, and make sure you're using that version of Python when you run python setup.py install. Something like PYTHONPATH=/usr/lib/python25 /usr/bin/python25 setup.py install.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜