所以我按照网站上的说明安装 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。
有可能 pip3 本来可以像 deathangel908 说的那样没有错误地完成它,但我没有测试它,因为上一行修复了这个问题。
一般用途:
python 3.x
sudo pip3 install tweepy
python 2.x
sudo pip install tweepy
关于python - 在 Ubuntu 上安装 tweepy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31325305/