安装sorl-thumbnail时的PermissionError

时间:2014-09-11 15:43:19

标签: python django python-3.x

使用python 3.4 / django 1.6。当您尝试安装模块sorl-thumbnail时,请收到以下错误消息:

15:18 ~/drummersaransk $ pip3.4 install sorl-thumbnail==11.12.1b
Downloading/unpacking sorl-thumbnail==11.12.1b
Downloading sorl_thumbnail-11.12.1b-py33-none-any.whl
Installing collected packages: sorl-thumbnail
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/local/lib/python3.4/dist-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/local/lib/python3.4/dist-packages/pip/req.py", line 901, in move_wheel_files
pycompile=self.pycompile,
File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py", line 215, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py", line 205, in clobber
os.makedirs(destdir)
File "/usr/lib/python3.4/os.py", line 237, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/sorl'


Storing debug log for failure in /home/drummersaransk/.pip/pip.log

3 个答案:

答案 0 :(得分:0)

你应该使用sudo或在virtualenv中运行pip

答案 1 :(得分:0)

如果它在您的计算机上,您必须在pip命令之前添加 sudo ,如下所示:

sudo pip3.4 install sorl-thumbnail==11.12.1b

答案 2 :(得分:-1)

对不起。我没注意。这是托管的正确解决方案:

pip3.4 install sorl-thumbnail==11.12.1b