pip install tweepy在mac上无效

时间:2017-05-27 09:01:21

标签: python pip tweepy

这些是我正在使用的版本

$ python --version
Python 2.7.10
$ pip --version 
pip 9.0.1 from /Library/Python/2.7/site-packages (python 2.7)

理想情况下,我应该可以安装tweepy。但那并没有发生。

$ pip install tweepy 
Collecting tweepy
  Using cached tweepy-3.5.0-py2.py3-none-any.whl
Collecting six>=1.7.3 (from tweepy)
  Using cached six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.4.3 in /Library/Python/2.7/site-packages (from tweepy)
Requirement already satisfied: requests-oauthlib>=0.4.1 in /Library/Python/2.7/site-packages (from tweepy)
Requirement already satisfied: oauthlib>=0.6.2 in /Library/Python/2.7/site-packages (from requests-oauthlib>=0.4.1->tweepy)
Installing collected packages: six, tweepy
  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/basecommand.py", line 215, in main
    status = self.run(options, args)

为简洁而删除了一堆行。它最终以......结束。

  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-CBvMLu-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

有人可以帮忙吗?

更新也尝试了以下操作。但没有解决问题

$ sudo -H pip install tweepy 

2 个答案:

答案 0 :(得分:1)

使用以下命令安装:

sudo pip install tweepy

看起来像是一个权限问题:)

答案 1 :(得分:0)

我遇到了同样的问题。我解决它的方法是从官方网站下载python 2.7.13并安装它。之后,我安装了pip:

sudo easy_install pip

之后:

pip install tweepy

希望它仍然相关:)