尝试使用命令安装wagtail
时,终端上显示异常:
pip install wagtail
返回:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
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/OleFileIO_PL.py
答案 0 :(得分:0)
答案就在那里,你可以看到:
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/OleFileIO_PL.py
您似乎正在尝试安装到您没有写入权限的全局site-packages目录(在Mac上)。
sudo pip install wagtail
可以解决这个问题,但我会建议不要这样做。
我强烈建议您为每个python项目使用python virtual environment。
另外,您是否有特殊原因要使用python2而不是python3启动新项目?