我只是有点难以理解为什么要执行此命令:
>appcfg.py -A adept-box-109804 update app.yaml
“立即试用 Google App Engine”页面提供的内容不起作用。我已经下载了适用于 Python 的 App Engine SDK,并将 Path 设置为指向 appcfg.py 的位置,但是在我的项目根目录中运行 appcfg.py 在命令行中不起作用。我要么必须导航到包含 appcfg.py 的文件夹并执行
>python appcfg.py help
或者做
>python "C:\Program Files (x86)\Google\google_appengine\appcfg.py" help
让命令在任何地方工作。我使用后一种方法来部署我的测试应用程序,但只是想知道是否有人可以解释为什么简单的 Google 教程给出的命令没有执行任何操作。我还检查以确保使用 Python 2.7 解释器自动打开 .py 文件,这样文件 hello.py 将在命令行中通过简单地键入来执行
>hello.py
它会输出它的打印语句。另一方面,无论参数如何,以类似方式使用 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.
最佳答案
我终于找到了真正的原因,这不是 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,我都不确定。
关于python-2.7 - appcfg.py 在命令行中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33131192/