我有一个程序,使用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
我知道最后一个错误可能与我在程序中如何使用头有关,但我不明白为什么tweetkey不能导入请求。这是我安装的模块。是什么导致了这一切?
1条答案
按热度按时间jutyujz01#
您可以在使用PYTHONPATH作为环境变量后安装在特定位置:
示例: