python - 在 Ubuntu 上安装 tweepy

标签 python ubuntu python-3.x tweepy

所以我按照网站上的说明安装 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/

相关文章:

c - strstr 函数不返回 NULL

python - 将字符串拆分为 2 个字母的段

python - Pygame 蛇吃自己

python - 从python中的迭代对象创建一个带有一组树的迭代对象

python - 使用 python 通过 IE 运行 Selenium 测试

python Stripe : 'module' object has no attribute 'Charge'

java - 将 MySQL 连接到 java 应用程序 - VPS (ubuntu)

python - Wand 中的相框功能在 Mac 上不起作用?

Python Flask,使用重新加载器重新启动 : What does that mean

ubuntu - 将 Web 请求指向在 Ubuntu 中运行的 Docker 容器