[英]Issues with Six module in Python2.7
当我尝试使用El Capitan 10.11.6在我的Mac上安装twilio时,问题就出现了。
我收到了这个错误:
OSError: [Errno 1] Operation not permitted: '/tmp/pip-EmsRHo-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pyOpenSSL-0.13.1-py2.7.egg-info'
研究通知我应该运行pip install --ignore-installed six
,这显示以下错误:
例外:
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 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/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-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/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/six.py'
进一步的研究告诉我运行brew install python
我再次尝试运行pip install twilio
新错误:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/Users/rdacso/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 48, in <module>
import six
ImportError: No module named six
我试图pip install six
,但继续得到这个错误:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/Users/rdacso/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 48, in <module>
import six
ImportError: No module named six
由于没有模块六,所有东西都显得很笨拙。 我无法安装或卸载六个。 甚至pip freeze也显示ImportError: No module named six
。
当我运行brew install python
我设法安装了第二个python库。 这导致了决斗蟒蛇。
我运行brew uninstall python
,使用easy_install pip
重新安装了pip,这让我有能力再次pip install six
。
完成后,我能够使用easy_install twilio
而不是pip install twilio
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.