importError:没有名为Coreapp的模块(Flask和googleappengine)

2024-04-19 03:07:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在本地服务器上运行和部署我的web应用。我正在学习如何使用googleappengine,当我命令dev时_应用服务器.pyflaskapp位于flaskapp上方的一个目录中,但在我的回购中,我得到以下错误:

uzuki@ubuntu:~/hw3p1s13$ ~/Downloads/google_appengine/dev_appserver.py flaskapp/
INFO     2013-03-18 03:43:12,890 appcfg.py:618] Checking for updates to the SDK.
INFO     2013-03-18 03:43:13,398 appcfg.py:636] The SDK is up to date.
WARNING  2013-03-18 03:43:13,398 dev_appserver.py:3578] The datastore file stub is    deprecated, and
will stop being the default in a future release.
append the --use_sqlite flag to use the new SQLite stub.

 You can port your existing data using the --port_sqlite_data flag or
 purge your previous test data with --clear_datastore.

 WARNING  2013-03-18 03:43:13,400 datastore_file_stub.py:528] Could not read datastore      data from /tmp/dev_appserver.datastore
 WARNING  2013-03-18 03:43:13,618 simple_search_stub.py:975] Could not read search   indexes from /tmp/dev_appserver.searchindexes
 INFO     2013-03-18 03:43:14,431 dev_appserver_multiprocess.py:656] Running application dev~robohw27 on port 8080:     http://localhost:8080
 INFO     2013-03-18 03:43:14,432 dev_appserver_multiprocess.py:658] Admin console is available at:     http://localhost:8080/_ah/admin
 ERROR    2013-03-18 03:44:05,236 wsgi.py:219] 
 Traceback (most recent call last):
 File "/home/uzuki/Downloads/google_appengine/google/appengine/runtime/wsgi.py", line 196, in Handle
 handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
 File "/home/uzuki/Downloads/google_appengine/google/appengine/runtime/wsgi.py", line 255, in _LoadHandler
handler = __import__(path[0])
ImportError: No module named coreapp
INFO     2013-03-18 03:44:05,265 dev_appserver.py:3104] "GET / HTTP/1.1" 500 -
ERROR    2013-03-18 03:44:07,858 wsgi.py:219] 

奇怪的是我有一个名为coreapp的目录,其中包含两个文件__init__.py和视图.py. __init__.py文件夹包含

^{pr2}$

还有我的视图.py文件处理对特定URL的HTTP请求。总而言之,它确实包含from coreapp import app。所以我不知道我做错了什么??在

只是想补充一下,在我的应用程序yaml文件在我的flaskapp目录中,它包含:

handlers
- url: .*
script : coreapp.app 

编辑:

大家好。我解决了我的问题,这太愚蠢了:

我想要“__init__.py”,但我有“__int__.py”。(严重的打字错误!)在

而且,我只是我的gedit编辑视图.py文件。但我有空格和错误的撇号。如果其他人也有类似的问题,请告诉我。在

谢谢你!我会在6小时内回答我自己的问题


Tags: 文件thepydevinfo目录wsgidata
2条回答

我解决了我的问题,这太愚蠢了:

我想要“__init__.py”,但我有“__int__.py”。(严重的打字错误!)在

而且,我只是我的gedit编辑视图.py文件。但我有空格和错误的撇号。如果其他人也有类似的问题,请告诉我。在

import sys
sys.path.append(whereever_coreapp_is)

相关问题 更多 >