python - Tweepy 没有在 anaconda jupyter 上运行
问题描述
我已经在 anaconda promptconda install -c conda-forge tweepy 上安装了 tweepy 但我收到以下错误任何想法?
import tweepy
输出:
Traceback (most recent call last):
File "C:\Users\user\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-1-f5e4f2180e08>", line 1, in <module> import tweepy
File "C:\Users\user\Anaconda3\lib\site-packages\tweepy\__init__.py", line 17, in <module> from tweepy.streaming import Stream, StreamListener
File "C:\Users\user\Anaconda3\lib\site-packages\tweepy\streaming.py", line 358 def _start(self, async):
^
SyntaxError: invalid syntax
解决方案
这个 GitHub 问题有答案:https ://github.com/tweepy/tweepy/issues/1017#issuecomment-387703653
本质上,async
是 Python 3.7 中的保留关键字,不能用作函数参数。引用问题的相关部分:
好的,找到了解决方案。显然 async 不能用作 Python 3.7 中的参数名称所以打开 streaming.py 并将 #async 替换为 async_ 它为我修复了错误。
推荐阅读
- sql - Sequelize - 在种子后重置自动增量:撤消:全部
- django - ufw 禁止 docker 容器连接到 postgres
- python - 使用 python 初学者级别的网页抓取
- android - 重载分辨率歧义。所有这些功能都匹配。在毕加索(入)功能
- python - 在python中将值从列表添加到字典
- python - 熊猫,从日期列创建缺少的日期字典
- unit-testing - unittest 异步模拟不适用于 pytest?
- java - 如何删除相机实例上的 OK 和 Cancel 按钮以进行 takepictureintent
- java - WSO2 Api Manager 3.2 - 自定义处理程序,没有登录文件,处理程序不起作用
- mysql - MySQL中的十进制到R