0

我从 OSX5 升级到 OSX6,它带有 Python 2.6。然后我不得不再次安装 pymongo 才能使用 Python 2.6,但我在安装时遇到了麻烦。当我运行 easy_install 或 pip 时,它会继续在 python 2.5 目录中安装 pymongo ...请参阅下面的终端输出。任何人都可以帮忙吗?如何为 Python 2.6 安装 pymongo?谢谢!

localhost:~ $ sudo easy_install -U setuptools
Password:
Searching for setup tools
Reading http://pypi.python.org/simple/setuptools/
Reading http://peak.telecommunity.com/snapshots/
Best match: setuptools 0.6c12dev-r88846
Processing setuptools-0.6c12dev_r88846-py2.6.egg
  setuptools 0.6c12dev-r88846 is already the active version in easy-install.pth
Installing easy_install script to /usr/local/bin
Installing easy_install-2.6 script to /usr/local/bin

Using /Library/Python/2.6/site-packages/setuptools-0.6c12dev_r88846-py2.6.egg
Processing dependencies for setuptools
Finished processing dependencies for setuptools localhost:~

$ python -m easy_install pymongo
Searching for pymongo
Best match: pymongo 2.0
Adding pymongo 2.0 to easy-install.pth file

Using /Library/Python/2.5/site-packages
Processing dependencies for pymongo
Finished processing dependencies for pymongo
4

1 回答 1

0

您需要将 Python 2.6 激活为 Python 的“当前”版本。超级用户的这篇文章解释了如何。

之后,您应该可以使用安装 pymongoeasy_install

于 2011-08-11T20:55:17.883 回答