我是 python 新手,我已经将它安装在 C:\ 中,并且我刚开始使用 GAE 的 Hello World 应用程序,我下载了 PyImgur 并通过 cmd 安装了它,但我在 gae 日志中python setup.py install
遇到错误。ImportError: No module named pyimgur
那么如何在我的 main.py 脚本中导入它呢?
应用程序.yaml
application: engineapp
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
主文件
import webapp2
import pyimgur
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello world!')
app = webapp2.WSGIApplication([
('/', MainHandler)
], debug=True)
这是 GAE 错误
INFO 2013-07-08 08:15:47,197 server.py:593] 默认值:“GET / HTTP/1.1”500 - INFO 2013-07-08 08:28:22,289 api_server.py:509] 应用所有待处理事务和保存数据存储 INFO 2013-07-08 08:28:22,289 api_server.py:512] 保存搜索索引 2013-07-08 08:28:22(进程退出,代码 0)
2013-07-08 08:28:23 运行命令:“['C:\Python27\pythonw.exe', 'C:\Program Files (x86)\Google\google_appengine\dev_appserver.py', '--skip_sdk_update_check=是','--port=8080','--admin_port=8000',u'C:\fb-app\engineapp']" INFO 2013-07-08 08:28:29,868 devappserver2.py:528] 跳过SDK 更新检查。INFO 2013-07-08 08:28:29,982 api_server.py:138] API 服务器启动于:http://localhost:59917
INFO 2013-07-08 08:28:29,989 dispatcher.py:164] 启动服务器“默认”运行于:http://localhost:8080
INFO 2013- 07-08 08:28:29,993 admin_server.py:117] 在以下位置启动管理服务器:http://localhost:8000
ERROR 2013-07-08 15:28:33,897 wsgi.py:219]
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 196, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 255, in _LoadHandler
handler = __import__(path[0])
File "C:\fb-app\engineapp\main.py", line 18, in <module>
import pyimgur
ImportError: No module named pyimgur
INFO 2013-07-08 08:28:33,907 server.py:593] default: "GET / HTTP/1.1" 500 -