ImportError:没有名为' twitter'

时间:2014-07-15 11:35:45

标签: python python-3.x twitter

第一个文件我正在尝试安装外部软件包 - twitter 1.14.3(在Windows 7上)

所以我将软件包下载到c:\ python33 \ twitter-1.14.3,

然后我跑:

python.exe c:\python33\twitter-1.14.3\setup.py install

Finished processing..

现在我正在尝试使用这个新模块:

from twitter import *

我收到一个错误:

Traceback (most recent call last):
File "test1.py", line 1, in <module>
\ufefffrom twitter import *
ImportError: No module named 'twitter'

当我试图运行twitter.exe时,我得到:

c:\Python33\Scripts>twitter.exe
Traceback (most recent call last):
  File "c:\Python33\Scripts\twitter-script.py", line 9, in <module>
    load_entry_point('twitter==1.14.3', 'console_scripts', 'twitter')()
  File "c:\Python33\lib\site-packages\setuptools-5.4.1-py3.3.egg\pkg_resources.py", line 356, in load_entry_point
  File "c:\Python33\lib\site-packages\setuptools-5.4.1-py3.3.egg\pkg_resources.py", line 2476, in load_entry_point
  File "c:\Python33\lib\site-packages\setuptools-5.4.1-py3.3.egg\pkg_resources.py", line 2190, in load
    ImportError: No module named 'twitter'

有什么想法吗?

感谢/

1 个答案:

答案 0 :(得分:0)

导航到您友好的邻居命令提示符并输入以下内容:

pip install twitter

它应该说“安装收集的软件包......成功安装twitter-1.18.0”

然后从IDE运行:

import twitter  # work with Twitter APIs

继续设置API密钥