gpt4 book ai didi

python - dev_appserver.py 没有那个文件或目录

转载 作者:太空宇宙 更新时间:2023-11-04 09:07:52 25 4
gpt4 key购买 nike

我正在尝试在开发中启用发送电子邮件。所以我需要运行服务器。我在我的应用程序所在的名为“交易”的目录中。(请参阅 pwd 和 ls)

Kenzos-MacBook-Pro:trade kenzotakahashi$ pwd
/Users/kenzotakahashi/desktop/main/WebDevelopment/project/trade
Kenzos-MacBook-Pro:trade kenzotakahashi$ ls
app.yaml main.pyc model.pyc util.py
main.py model.py templates util.pyc

但是我得到了这个错误。

Kenzos-MacBook-Pro:trade kenzotakahashi$ dev_appserver.py trade
Traceback (most recent call last):
File "/usr/local/bin/dev_appserver.py", line 184, in <module>
_run_file(__file__, globals())
File "/usr/local/bin/dev_appserver.py", line 180, in _run_file
execfile(script_path, globals_)
File "/Users/kenzotakahashi/Desktop/main/WebDevelopment/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 727, in <module>
main()
File "/Users/kenzotakahashi/Desktop/main/WebDevelopment/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 720, in main
dev_server.start(options)
File "/Users/kenzotakahashi/Desktop/main/WebDevelopment/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 554, in start
options.yaml_files)
File "/Users/kenzotakahashi/Desktop/main/WebDevelopment/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 556, in __init__
module_configuration = ModuleConfiguration(yaml_path)
File "/Users/kenzotakahashi/Desktop/main/WebDevelopment/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 82, in __init__
self._yaml_path)
File "/Users/kenzotakahashi/Desktop/main/WebDevelopment/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 271, in _parse_configuration
with open(configuration_path) as f:
IOError: [Errno 2] No such file or directory: 'trade'
Kenzos-MacBook-Pro:trade kenzotakahashi$

这是我的 app.yaml

application: trade
version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /static
static_dir: static

- url: /.*
script: main.app

libraries:
- name: jinja2
version: latest

- name: PIL
version: "1.1.7"

我知道没有名为“trade”的文件,但谷歌文档显示“dev_appserver.py myapp”所以我认为“贸易”将是我的应用程序名称。我还尝试过将 dev_appserver.py 与“main.py”、“main.app”、“main”一起使用,但它们都不起作用。我做错了什么?

最佳答案

运行dev_appserver.py时需要指定路径。如果您从 trade 目录中运行应用程序服务器,您可以运行任一

dev_appserver.py .

dev_appserver.py ../trade

另一种运行它的方法是cd .. 所以你在包含trade 的目录中然后运行

dev_appserver.py trade

关于python - dev_appserver.py 没有那个文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18326371/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com