在 Ubuntu 上安装 tweepy

Install tweepy on Ubuntu

所以我按照网站上的说明安装了 tweepy:

git clone https://github.com/tweepy/tweepy.git
cd tweepy
python setup.py install

出于权限原因,我必须做的唯一修改是 sudo python3 setup.py install 并为 python 3.4

安装

我一直收到错误消息:

six 1.5.2 is already the active version in easy-install.pth

Installed /usr/local/lib/python3.4/dist-packages/six-1.5.2-py3.4.egg error: Could not find required distribution six>=1.7.3

但是如果我输入:

$ pip freeze | grep six
six==1.9.0. 
$ pip freeze | grep tweepy
tweepy==3.3.0

如果我在我的机器上简单地导入 tweepy,我会得到 ImportError: No module names 'requests_oauthlib'。我错过了哪一步?

安装在我的 windows 计算机上运行良好,但在我的 Ubuntu 计算机(不是 VM)上我遇到了这些错误。

根据我的发现,在我的情况下,因为 tweepy 安装在 python 3.4 下,但不知何故 oauthlib 不是,我 运行 $ sudo python3 -m pip install requests requests_oauthlib 修复了错误,我是能够正确导入tweepy。

有可能像deathangel908说的那样,pip3原本可以无误地完成,但我没有测试,因为上一行已经解决了这个问题。

一般用途:

Python 3.x

sudo pip3 install tweepy

Python 2.x

sudo pip install tweepy