OSError: [Errno 1] Operation not permitted: '/tmp/pip-g3bg0s-uninstall/System/Library/Frameworks/Pyt
2017-08-02 12:46
573 查看
一、问题描述
在用下列名字安装时
sudo -H pip install Scrapy
sudo pip install virtualenvwrapper
出现下列错误
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to
the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py",
line 215, in main
status = self.run(options, args)
File "/Library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py",
line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-g3bg0s-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
二、问题分析解决:
Scrapy,virtualenvwrapper需要依赖six,在安装six的时候发现系统已经有一个six-1.4.1,但是virtualenvwrapper需要six-1.9.0,于是想先卸载老版本的six,此时问题来了,发现没有权限卸载,此时我就纳闷,加上sudo,还是没权限。于是Google之,最终还是在万能的GitHub找到答案。six-1.4.1是系统内置的packages,因 系统集成保护 你是没有权限去修改/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info目录的。因此在安装virtualenvwrapper的时候需要选择忽略six的安装:
sudo pip install virtualenvwrapper --upgrade --ignore-installed six
sudo pip install Scrapy --upgrade --ignore-installed six
在用下列名字安装时
sudo -H pip install Scrapy
sudo pip install virtualenvwrapper
出现下列错误
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to
the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py",
line 215, in main
status = self.run(options, args)
File "/Library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py",
line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-g3bg0s-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
二、问题分析解决:
Scrapy,virtualenvwrapper需要依赖six,在安装six的时候发现系统已经有一个six-1.4.1,但是virtualenvwrapper需要six-1.9.0,于是想先卸载老版本的six,此时问题来了,发现没有权限卸载,此时我就纳闷,加上sudo,还是没权限。于是Google之,最终还是在万能的GitHub找到答案。six-1.4.1是系统内置的packages,因 系统集成保护 你是没有权限去修改/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info目录的。因此在安装virtualenvwrapper的时候需要选择忽略six的安装:
sudo pip install virtualenvwrapper --upgrade --ignore-installed six
sudo pip install Scrapy --upgrade --ignore-installed six
相关文章推荐
- Mac OS X El Capitan (10.11) sudo pip install 报错 “OSError: [Errno 1] Operation not permitted”
- “OSError: [Errno 1] Operation not permitted” when installing Scrapy in OSX 10.11 (El Capitan) (System Integrity Protection)
- OSError: [Errno 1] Operation not permitted
- macosx 10.11 python pip install 出现错误OSError: [Errno 1] Operation not permitted:
- MAC下解决pip安装权限问题 OSError: [Errno 13] Permission denied OSError: [Errno 1] Operation not permitted:
- Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
- 解决 mac OSX pip OSError: [Errno 1] Operation not permitted
- MAC 解决OSError: [Errno 1] Operation not permitted
- ln: /System/Library/Perl/Extras/5.18/SVN: Operation not permitted
- OSError: [Errno 1] Operation not permitted
- 启动MongoDB时出现Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
- macosx 10.11 python pip install 出现错误OSError: [Errno 1] Operation not permitted:
- 【Python学习笔记】macosx 10.11 python pip install 出现错误OSError: [Errno 1] Operation not permitted:
- 解决 mac安装或者更新第三方包安装不上的问题 mac OSX pip OSError: [Errno 1] Operation not permitted
- [iOS Xcode8报错]dyld: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/UserN
- Docker Container Centos7 systemctl 提示 Failed to get D-Bus connection: Operation not permitted
- npm ERR! errno -4048,Error: EPERM: operation not permitted
- [mongoDB]Failed to unlink socket file /tmp/mongodb-[portnum].sock Operation not permitted
- npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法
- [iOS Xcode8报错]dyld: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/UserN