ImportError:请求存在时没有名为请求的模块

时间:2017-04-24 01:04:07

标签: python apache cgi

我有一个使用cgi与网站连接的程序。它在脚本工作时运行程序时有效,但是,当我尝试将其与网站界面连接时,我在错误日志中收到以下错误:

Traceback (most recent call last):
  File "/usr/lib/cgi-bin/revealMessage.py", line 2, in <module>
    import tweepy
  File "/usr/local/lib/python2.7/dist-packages/tweepy/__init__.py", line 14, in <module>
    from tweepy.api import API
  File "/usr/local/lib/python2.7/dist-packages/tweepy/api.py", line 12, in <module>
    from tweepy.binder import bind_api
  File "/usr/local/lib/python2.7/dist-packages/tweepy/binder.py", line 11, in <module>
    import requests
ImportError: No module named requests
[Mon Apr 24 01:49:50.997808 2017] [cgid:error] [pid 1593:tid 139798939764480] [client 127.0.0.1:56852] End of script output before headers: revealMessage.py, referer: http://localhost/hidden.html

我理解最后一个错误可能与我在程序中使用标头的方式有关,但我不明白为什么tweepy无法导入请求。这是我安装的模块。什么可以使这种情况发生?

0 个答案:

没有答案