我对mongo没有任何经验。当我想在OS X上安装mongo-connector 1.2.1时,我收到这些错误消息。问题在哪里?
pip install -I mongo-connector == 1.2.1
Downloading/unpacking mongo-connector==1.2.1
Downloading mongo_connector-1.2.1-py2.py3-none-any.whl (51kB): 51kB downloaded
Downloading/unpacking elasticsearch (from mongo-connector==1.2.1)
Downloading elasticsearch-1.4.0-py2.py3-none-any.whl (56kB): 56kB downloaded
Downloading/unpacking pysolr>=3.1.0 (from mongo-connector==1.2.1)
Downloading pysolr-3.3.0-py2.py3-none-any.whl
Downloading/unpacking pymongo>=2.4 (from mongo-connector==1.2.1)
Downloading pymongo-2.8-cp27-none-macosx_10_9_intel.whl (239kB): 239kB downloaded
Downloading/unpacking urllib3>=1.8,<2.0 (from elasticsearch->mongo-connector==1.2.1)
Downloading urllib3-1.10.1-py2-none-any.whl (76kB): 76kB downloaded
Downloading/unpacking requests>=2.0 (from pysolr>=3.1.0->mongo-connector==1.2.1)
Downloading requests-2.5.1-py2.py3-none-any.whl (464kB): 464kB downloaded
Installing collected packages: mongo-connector, elasticsearch, pysolr, pymongo, urllib3, requests
Cleaning up...
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.7/site-packages/pip/req.py", line 901, in move_wheel_files
pycompile=self.pycompile,
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 215, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 209, in clobber
shutil.copy2(srcfile, destfile)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 130, in copy2
copyfile(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/mongo_connector/__init__.py'
Storing debug log for failure in /Users/and/Library/Logs/pip.log
答案 0 :(得分:1)
这是一个permmision问题,所以
尝试在虚拟环境中安装,否则使用sudo pip
sudo pip install -I mongo-connector==1.2.1