簡體   English   中英

Python2.7中六個模塊的問題

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM