Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在自定义python上轻松安装时出现问题_Python_Macos_Easy Install_Egg - Fatal编程技术网

在自定义python上轻松安装时出现问题

在自定义python上轻松安装时出现问题,python,macos,easy-install,egg,Python,Macos,Easy Install,Egg,我有一个MacOSX,我有机器附带的普通python,还有我已经下载过的新版本,运行得非常好。这是在 $ which python /Library/Frameworks/Python.framework/Versions/2.6/bin/python Easy_install仅适用于标准版本: $ which easy_install /usr/bin/easy_install 所以我下载了setuptools-0.6c11-py2.6.egg,然后 $ cd Downloads/ $ s

我有一个MacOSX,我有机器附带的普通python,还有我已经下载过的新版本,运行得非常好。这是在

$ which python
/Library/Frameworks/Python.framework/Versions/2.6/bin/python
Easy_install仅适用于标准版本:

$ which easy_install
/usr/bin/easy_install
所以我下载了setuptools-0.6c11-py2.6.egg,然后

$ cd Downloads/
$ sudo sh setuptools-0.6c11-py2.6.egg 
Password:

Processing setuptools-0.6c11-py2.6.egg
Copying setuptools-0.6c11-py2.6.egg to /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install script to /Library/Frameworks/Python.framework/Versions/2.6/bin
Installing easy_install-2.6 script to /Library/Frameworks/Python.framework/Versions/2.6/bin

Installed /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
这似乎奏效了

$ which easy_install
/Library/Frameworks/Python.framework/Versions/2.6/bin/easy_install
但有些东西仍然不起作用:

$ easy_install pymongoSearching for pymongo
Reading http://pypi.python.org/simple/pymongo/
Reading http://github.com/mongodb/mongo-python-driver
Best match: pymongo 1.9
Downloading http://pypi.python.org/packages/source/p/pymongo/pymongo-1.9.tar.gz#md5=12e12163e6cc22993808900fb9629252
Processing pymongo-1.9.tar.gz
Running pymongo-1.9/setup.py -q bdist_egg --dist-dir /var/folders/vm/vmoE5XqwH-yKiaMzAQS1vE+++TI/-Tmp-/easy_install-lRHv7W/pymongo-1.9/egg-dist-tmp-xFybXs
warning: no files found matching '*.h' under directory 'pymongo'
In file included from /usr/include/architecture/i386/math.h:626,
                 from /usr/include/math.h:28,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58,
                 from bson/_cbsonmodule.c:23:
/usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid.
In file included from /usr/include/architecture/i386/math.h:626,
                 from /usr/include/math.h:28,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58,
                 from pymongo/_cmessagemodule.c:23:
/usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid.
In file included from /usr/include/architecture/i386/math.h:626,
                 from /usr/include/math.h:28,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58,
                 from bson/_cbsonmodule.c:23:
/usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid.
zip_safe flag not set; analyzing archive contents...
Adding pymongo 1.9 to easy-install.pth file
error: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/easy-install.pth: Permission denied
$easy\u为pymongo安装pymongoSearching
阅读http://pypi.python.org/simple/pymongo/
阅读http://github.com/mongodb/mongo-python-driver
最佳匹配:pymongo 1.9
正在下载http://pypi.python.org/packages/source/p/pymongo/pymongo-1.9.tar.gz#md5=12e12163e6cc22993808900fb9629252
加工pymongo-1.9.tar.gz
运行pymongo-1.9/setup.py-q bdist_egg--dist dir/var/folders/vm/vmoE5XqwH-yKiaMzAQS1vE++TI/-Tmp-/easy_install-lRHv7W/pymongo-1.9/egg-dist-Tmp-xFybXs
警告:在目录“pymongo”下找不到与“*.h”匹配的文件
在/usr/include/architecture/i386/math.h:626中包含的文件中,
from/usr/include/math.h:28,
从/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235,
从/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58,
来自bson/_cbsonmodule.c:23:
/usr/include/AvailabilityMacros.h:108:14:warning:#针对Mac OS X部署目标<10.4的英特尔的警告生成无效。
在/usr/include/architecture/i386/math.h:626中包含的文件中,
from/usr/include/math.h:28,
从/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235,
从/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58,
来自pymongo/_cmessagemodule.c:23:
/usr/include/AvailabilityMacros.h:108:14:warning:#针对Mac OS X部署目标<10.4的英特尔的警告生成无效。
在/usr/include/architecture/i386/math.h:626中包含的文件中,
from/usr/include/math.h:28,
从/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235,
从/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58,
来自bson/_cbsonmodule.c:23:
/usr/include/AvailabilityMacros.h:108:14:warning:#针对Mac OS X部署目标<10.4的英特尔的警告生成无效。
未设置zip_安全标志;正在分析存档内容。。。
将pymongo 1.9添加到easy-install.pth文件
错误:/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/easy-install.pth:权限被拒绝
然后,当我使用python时

import pymongo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pymongo
导入pymongo
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:没有名为pymongo的模块
我做错了什么


非常感谢

您是否尝试过这样做:
轻松安装pymongo

当您在空闲状态下导入pymongo时,会返回什么

error: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/easy-install.pth: Permission denied

您必须以root权限运行
easy\u install

游戏有点晚了,但我在OSX 10.6.7上成功地完成了以下操作:

easy_install pip
然后:


是的,我在做这一切之前做过。Easy install在python中安装pymongo,但不是在我使用的python版本中。我认为它没有被安装。看最后一行的错误。所以当我导入pymongo时,他也会给我一个ImporterOrthanks。它确实奏效了。我试着简单地安装。但这是行不通的。我不得不这么做。
pip install pymongo