我已经安装了tweepy上的anaconda提示,安装-c conda-伪造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发布于 2019-04-23 16:41:09
这个GitHub问题的答案是:https://github.com/tweepy/tweepy/issues/1017#issuecomment-387703653
本质上,async是Python3.7中的保留关键字,不能用作函数参数。引用问题的有关部分:
好了找到解决办法了。显然,在Python3.7中异步不能用作参数名,所以打开streaming.py并用async_替换#异步,它为我修复了错误。
https://stackoverflow.com/questions/55815833
复制相似问题