appcfg.py无法在命令行中运行

Tow*_*er7 2 google-app-engine python-2.7 appcfg

我只是在理解为什么这个命令时遇到了一些麻烦:

>appcfg.py -A adept-box-109804 update app.yaml
Run Code Online (Sandbox Code Playgroud)

由Try Google App Engine Now页面提供的功能不起作用.我已下载App Engine SDK for Python,并将Path设置为指向appcfg.py的位置,但在我的项目根目录中运行appcfg.py在命令行中不起作用.我要么导航到包含appcfg.py的文件夹并执行操作

>python appcfg.py help
Run Code Online (Sandbox Code Playgroud)

或者做

>python "C:\Program Files (x86)\Google\google_appengine\appcfg.py" help
Run Code Online (Sandbox Code Playgroud)

从任何地方获得命令.我使用后一种方法来部署我的测试应用程序,但只是想知道是否有人可以解释为什么简单的Google教程给出的命令没有做任何事情.我还检查了确保.py文件是使用Python 2.7解释器自动打开的,这样只需输入一个文件hello.py就可以在命令行中执行

>hello.py
Run Code Online (Sandbox Code Playgroud)

它将输出其打印声明.另一方面,使用appcfg.py以类似的方式提供相同的输出,无论参数如何(请注意我截断了输出,但请放心,无论参数如何,它们都是相同的:

C:\>appcfg.py help backends
Usage: appcfg.py [options] <action>

Action must be one of:
  backends: Perform a backend action.
  backends configure: Reconfigure a backend without stopping it.
  backends delete: Delete a backend.
  backends list: List all backends configured for the app.
  backends rollback: Roll back an update of a backend.
  backends start: Start a backend.
  backends stop: Stop a backend.
  backends update: Update one or more backends.
  create_bulkloader_config: Create a bulkloader.yaml from a running application.
  cron_info: Display information about cron jobs.
  delete_version: Delete the specified version for an app.
  download_app: Download a previously-uploaded app.
  download_data: Download entities from datastore.
  help: Print help for a specific action.
  list_versions: List all uploaded versions for an app.
  request_logs: Write request logs in Apache common log format.
  resource_limits_info: Get the resource limits.
  rollback: Rollback an in-progress update.
  set_default_version: Set the default (serving) version.
  start_module_version: Start a module version.
  stop_module_version: Stop a module version.
  update: Create or update an app version.
  update_cron: Update application cron definitions.
  update_dispatch: Update application dispatch definitions.
  update_dos: Update application dos definitions.
  update_indexes: Update application indexes.
  update_queues: Update application task queue definitions.
  upload_data: Upload data records to datastore.
  vacuum_indexes: Delete unused indexes from application.
Use 'help <action>' for a detailed description.

C:\>appcfg.py help update
Usage: appcfg.py [options] <action>

Action must be one of:
  backends: Perform a backend action.
  backends configure: Reconfigure a backend without stopping it.
  backends delete: Delete a backend.
  backends list: List all backends configured for the app.
  backends rollback: Roll back an update of a backend.
  backends start: Start a backend.
  backends stop: Stop a backend.
  backends update: Update one or more backends.
  create_bulkloader_config: Create a bulkloader.yaml from a running application.
  cron_info: Display information about cron jobs.
  delete_version: Delete the specified version for an app.
  download_app: Download a previously-uploaded app.
  download_data: Download entities from datastore.
  help: Print help for a specific action.
  list_versions: List all uploaded versions for an app.
  request_logs: Write request logs in Apache common log format.
  resource_limits_info: Get the resource limits.
  rollback: Rollback an in-progress update.
  set_default_version: Set the default (serving) version.
  start_module_version: Start a module version.
  stop_module_version: Stop a module version.
  update: Create or update an app version.
  update_cron: Update application cron definitions.
  update_dispatch: Update application dispatch definitions.
  update_dos: Update application dos definitions.
  update_indexes: Update application indexes.
  update_queues: Update application task queue definitions.
  upload_data: Upload data records to datastore.
  vacuum_indexes: Delete unused indexes from application.
Use 'help <action>' for a detailed description.
Run Code Online (Sandbox Code Playgroud)

Tow*_*er7 6

我终于找到了真正的原因,这不是AppEngine SDK的错误.相反,它是我的Python解释器,因为我注意到它不接受任何.py文件的参数.事实证明这是一个注册表错​​误,位于[HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command]我必须将值更改"C:\Python27\python.exe" "%1"为的位置"C:\Python27\python.exe" "%1" %*

这是怎么回事,无论是Python 2.7安装程序,还是AppEngine SDK,我都不确定.