gpt4 book ai didi

python - Tweepy 未在 anaconda jupyter 上运行

转载 作者:行者123 更新时间:2023-12-01 01:00:40 31 4
gpt4 key购买 nike

我已经在 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中的保留关键字,不能用作函数参数。引用问题的相关部分:

Okay found the solution. Apparently async cannot be used as an argument name in Python 3.7 So open streaming.py and replace #async with async_ it fixed the error for me.

关于python - Tweepy 未在 anaconda jupyter 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55815833/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com