我安装了twint与:
pip3 install twint
导致安装成功:
Successfully installed twint-2.1.8
[它可以使用命令提示符(CLI)命令从twitter
获取推文,但是当我尝试在Spyder
IDE中运行示例时,它给了我错误:
"Traceback (most recent call last):
File "<ipython-input-13-7b77905cef0c>", line 1, in <module>
runfile('C:/Users/myname/twint.py', wdir='C:/Users/myname')
File "C:\Users\myname\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "C:\Users\myname\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/myname/twint.py", line 8, in <module>
import twint
File "C:\Users\myname\twint.py", line 9, in <module>
c = twint.Config()
AttributeError: module 'twint' has no attribute 'Config'
这是我的代码:
import twint
c = twint.Config()
c.Username = "twitterAccountName"
twint.run.Search(c)
但是,我在GitHub上发现了与Twint相关的问题,发现here,但此处提供的解决方案不适用于我。有谁知道错误来自哪里?我该如何解决?
如果遇到其他错误,那就是另外一个问题