python - GAE Python : dev_appserver. py:错误:参数太少

标签 python python-2.7 google-app-engine anaconda

我正在尝试运行此处描述的基本 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
    • 自述文件

我尝试从“项目”文件夹和“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/

相关文章:

python - 在 Python 中调用函数时是否总是必须引用包?

python - 如何将列表字典转换为 Pandas 中的数据框

mongodb - 在谷歌云平台上部署mongodb?

python-2.7 - URLFetch Max Deadline 对于 TaskQueues 只有 60 秒

python - Python 2.7 View 、for/in 和修改可以很好地协同工作吗?

python - Google AppEngine Python 3.7 上的自定义库

java - 克服谷歌数据存储的 30 个子查询限制

java - Unix base64 编码不匹配

python - 允许单个 IP 使用 HTTPBasicAuth 通过 Flask 进行身份验证

python-2.7 - Django 1.4 导入错误 No module named apps