我刚尝试在Mac上安装Fabric,使用pip install fabric
Installing collected packages: fabric, paramiko, pycrypto, ecdsa
Cleaning up...
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5-py2.7.egg/pip/commands/install.py", line 275, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip-1.5-py2.7.egg/pip/req.py", line 1371, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip-1.5-py2.7.egg/pip/req.py", line 655, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.7/site-packages/pip-1.5-py2.7.egg/pip/req.py", line 885, in move_wheel_files
pycompile=self.pycompile,
File "/Library/Python/2.7/site-packages/pip-1.5-py2.7.egg/pip/wheel.py", line 209, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-1.5-py2.7.egg/pip/wheel.py", line 196, in clobber
os.makedirs(destsubdir)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/fabfile'
Storing debug log for failure in /Users/michaelsnowden/Library/Logs/pip.log
以下是整个debug log
这是什么意思,为什么我会收到此错误?
答案 0 :(得分:0)
对于系统范围的pip安装,你需要做一个sudo:
sudo pip install fabric
由于系统范围的程序包在全局范围内可用,因此它们是在具有普通用户写入权限的路径之外编写的。在这种情况下,你需要做一个sudo其他权限写入这些文件夹将被拒绝给你。
全局安装后,您可以在系统中的任何位置调用Python解释器,并且import fabric
可供您使用。此外,它适用于您系统的任何用户。