为了账号安全,请及时绑定邮箱和手机立即绑定

使用pip安装PIL时出错

使用pip安装PIL时出错

繁星coding 2021-03-17 14:11:48
我正在尝试使用以下命令使用pip安装PIL:pip install PIL但我收到以下错误,我不知道这意味着什么。有人可以帮帮我。nishant@nishant-Inspiron-1545:~$ pip install PILRequirement already satisfied (use --upgrade to upgrade): PIL in /usr/lib/python2.7/dist-packages/PILCleaning up...Exception:Traceback (most recent call last):File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 104, in mainstatus = self.run(options, args)File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 265, in runrequirement_set.cleanup_files(bundle=self.bundle)File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1081, in cleanup_filesrmtree(dir)File "/usr/lib/python2.7/dist-packages/pip/util.py", line 29, in rmtreeonerror=rmtree_errorhandler)File "/usr/lib/python2.7/shutil.py", line 252, in rmtreeonerror(os.remove, fullname, sys.exc_info())File "/usr/lib/python2.7/dist-packages/pip/util.py", line 46, in rmtree_errorhandleros.chmod(path, stat.S_IWRITE)OSError: [Errno 1] Operation not permitted: '/home/nishant/build/pip-delete-this-directory.txt'Storing complete log in /home/nishant/.pip/pip.logTraceback (most recent call last):File "/usr/bin/pip", line 9, in <module>load_entry_point('pip==1.1', 'console_scripts', 'pip-2.7')()File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 116, in mainreturn command.main(args[1:], options)File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 141, in mainlog_fp = open_logfile(log_fn, 'w')File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 168, in open_logfilelog_fp = open(filename, mode)IOError: [Errno 13] Permission denied: '/home/nishant/.pip/pip.log'
查看完整描述

3 回答

?
慕容708150

TA贡献1831条经验 获得超4个赞

您有权限问题。尝试:

sudo pip install -U PIL


查看完整回答
反对 回复 2021-03-24
?
一只甜甜圈

TA贡献1836条经验 获得超5个赞

在Mac OSX 10.10.4和Python 2.7.5上为我工作

sudo pip install pillow

当然,您必须预先安装pip才能正常工作


查看完整回答
反对 回复 2021-03-24
  • 3 回答
  • 0 关注
  • 396 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信