加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

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

发布时间:2020-12-20 12:38:32 所属栏目:Python 来源:网络整理
导读:我正在尝试运行此处描述的基本helloworld代码 https://cloud.google.com/appengine/docs/python/.但是,每当我尝试使用dev_appserver.py helloworld /命令时,我都会收到dev_appserver.py命令的使用错误. 我已经安装了Python 2.7,并且在我的系统上安装了Python
我正在尝试运行此处描述的基本helloworld代码 https://cloud.google.com/appengine/docs/python/.但是,每当我尝试使用dev_appserver.py helloworld /命令时,我都会收到dev_appserver.py命令的使用错误.

我已经安装了Python 2.7,并且在我的系统上安装了Python 2.7 Anaconda. Anaconda Python可能是问题的原因吗?

我的代码的文件结构如下:

>项目

> helloworld

> app.yaml
> helloworld.py

> README.md

我尝试从’Project’文件夹和’helloworld’文件夹中执行dev_appserver.py helloworld /命令.但在这两种情况下我都得到同样的错误.

任何帮助将不胜感激!

谢谢!

解决方法

我想我已经找到了这个错误背后的“真实”问题.

尝试将一些print语句放在dev_appserver.py文件中,发现我们给出的任何参数都没有被传递,因此错误.在谷歌搜索遇到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_ROOTPython.Fileshellopencommand):

[HKEY_CLASSES_ROOTApplicationspython.exeshellopencommand]
@=""C:Python25python.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).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读