我正在尝试运行此处描述的基本 helloworld 代码 https://cloud.google.com/appengine/docs/python/ .但是,每当我尝试 dev_appserver.py helloworld/命令时,我都会收到 dev_appserver.py 命令的使用错误。
我已经安装了 Python 2.7,还在我的系统上安装了 Python 2.7 Anaconda。 Anaconda Python 可能是问题的原因吗?
我的代码的文件结构如下:
- 项目
- Hello World
- 应用.yaml
- helloworld.py
- 自述文件
- Hello World
我尝试从“项目”文件夹和“helloworld”文件夹中执行 dev_appserver.py helloworld/命令。但是在这两种情况下我都会遇到同样的错误。
任何帮助将不胜感激!
谢谢!
最佳答案
我想我已经找到了这个错误背后的“真正”问题。
尝试在 dev_appserver.py
文件中放置一些 print
语句,发现我们给出的任何参数都没有被传递,因此出现了错误。谷歌搜索发现 this SO帖子解释了这个问题。在进行更改时,以下命令完美运行:D
dev_appserver.py app.yaml
引用该 SO 答案以便于引用:
I think I solved this. For some reason there is a SECOND place in the registry (besides that shown by the file associations stored in HKEY_CLASSES_ROOT\Python.File\shell\open\command):
[HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command] @="\"C:\\Python25\\python.exe\" \"%1\" %*"
This seems to be the controlling setting on my system. The registry setting above adds the "%*" to pass all arguments to python.exe (it was missing in my registry for some reason).
关于python - GAE Python : dev_appserver. py:错误:参数太少,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36805871/