首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >:没有名为tweepy的模块

:没有名为tweepy的模块
EN

Stack Overflow用户
提问于 2018-03-23 17:46:04
回答 7查看 19.2K关注 0票数 4

我安装了pip install tweepy,它安装时没有出现错误。

代码语言:javascript
复制
Requirement already satisfied: tweepy in /Library/Python/2.7/site-packages
Requirement already satisfied: requests>=2.11.1 in /Library/Python/2.7/site-packages (from tweepy)
Requirement already satisfied: PySocks>=1.5.7 in /Library/Python/2.7/site-packages (from tweepy)
Requirement already satisfied: six>=1.10.0 in /Library/Python/2.7/site-packages (from tweepy)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /Library/Python/2.7/site-packages (from tweepy)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Python/2.7/site-packages (from requests>=2.11.1->tweepy)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Library/Python/2.7/site-packages (from requests>=2.11.1->tweepy)
Requirement already satisfied: idna<2.7,>=2.5 in /Library/Python/2.7/site-packages (from requests>=2.11.1->tweepy)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /Library/Python/2.7/site-packages (from requests>=2.11.1->tweepy)
Requirement already satisfied: oauthlib>=0.6.2 in /Library/Python/2.7/site-packages (from requests-oauthlib>=0.7.0->tweepy)

这是我的代码:

代码语言:javascript
复制
import tweepy
from tweepy import OAuthHandler

consumer_key = 'consumer_key'
consumer_secret = 'consumer_secret'

access_token = 'access_token'
access_token_secret = 'access_token_secret'

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)

public_tweepy.API('Yunus Hatipoglu')

for tweet in public_tweets:
    print(tweet.text)
    analysis = TextBlob(tweet.text)
    print(analysis.sentiment)

作为应用程序,我使用Pycharm,我的操作系统是OSX。

python3 --版本:Python3.6.4

当我运行我的代码时,我会得到以下错误:

进口吐温 ImportError:没有名为tweepy的模块

EN

回答 7

Stack Overflow用户

回答已采纳

发布于 2018-03-23 18:18:26

在PyCharm中,设置->项目解释器-> + -> tweepy ->安装包。

通过以上操作,Tweepy已经在PyCharm终端上工作了。

另一方面,我通过输入python3 -m pip install tweepy安装了tweepy

票数 6
EN

Stack Overflow用户

发布于 2018-03-23 18:00:20

尝试通过以下命令安装:

代码语言:javascript
复制
python3 -m pip install tweepy
票数 4
EN

Stack Overflow用户

发布于 2020-03-31 14:51:51

我直接将它安装在Python文件夹中,但它对我不起作用。

之后,我在同一提示符下使用:pip uninstall tweepy卸载。

所以,我使用了Anaconda提示符,在代码:pip install tweepy之后,它为我工作。

我希望这是有用的。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49455602

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档