Error running google app engine: unrecognized argu

2019-02-23 18:50发布

问题:

I'm following the 'Getting Started with Python App Engine' tutorial and I can't seem to connect to the development server. I keep getting the following error from the log console when I try running it.

2013-08-23 09:46:43 PM Running command: "[u'/usr/bin/python', '/home/mathee/google_appengine/dev_appserver.py', '--admin_console_server=', '--port=8080', '/home/mathee/app']"
usage: dev_appserver.py [-h] [--host HOST] [--port PORT]
                    [--admin_host ADMIN_HOST] [--admin_port ADMIN_PORT]
                    [--auth_domain AUTH_DOMAIN] [--storage_path PATH]
                    [--log_level {debug,info,warning,critical,error}]
                    [--max_module_instances MAX_MODULE_INSTANCES]
                    [--use_mtime_file_watcher [USE_MTIME_FILE_WATCHER]]
                    [--php_executable_path PATH]
                    [--php_remote_debugging [PHP_REMOTE_DEBUGGING]]
                    [--python_startup_script PYTHON_STARTUP_SCRIPT]
                    [--python_startup_args PYTHON_STARTUP_ARGS]
                    [--blobstore_path BLOBSTORE_PATH]
                    [--mysql_host MYSQL_HOST] [--mysql_port MYSQL_PORT]
                    [--mysql_user MYSQL_USER]
                    [--mysql_password MYSQL_PASSWORD]
                    [--mysql_socket MYSQL_SOCKET]
                    [--datastore_path DATASTORE_PATH]
                    [--clear_datastore [CLEAR_DATASTORE]]
                    [--datastore_consistency_policy {consistent,random,time}]
                    [--require_indexes [REQUIRE_INDEXES]]
                    [--auto_id_policy {sequential,scattered}]
                    [--logs_path LOGS_PATH]
                    [--show_mail_body [SHOW_MAIL_BODY]]
                    [--enable_sendmail [ENABLE_SENDMAIL]]
                    [--smtp_host SMTP_HOST] [--smtp_port SMTP_PORT]
                    [--smtp_user SMTP_USER]
                    [--smtp_password SMTP_PASSWORD]
                    [--prospective_search_path PROSPECTIVE_SEARCH_PATH]
                    [--clear_prospective_search [CLEAR_PROSPECTIVE_SEARCH]]
                    [--search_indexes_path SEARCH_INDEXES_PATH]
                    [--clear_search_indexes [CLEAR_SEARCH_INDEXES]]
                    [--enable_task_running [ENABLE_TASK_RUNNING]]
                    [--allow_skipped_files [ALLOW_SKIPPED_FILES]]
                    [--api_port API_PORT]
                    [--automatic_restart [AUTOMATIC_RESTART]]
                    [--dev_appserver_log_level {debug,info,warning,critical,error}]
                    [--skip_sdk_update_check [SKIP_SDK_UPDATE_CHECK]]
                    [--default_gcs_bucket_name DEFAULT_GCS_BUCKET_NAME]
                    yaml_files [yaml_files ...]
dev_appserver.py: error: unrecognized arguments: --admin_console_server= 2013-08-23 09:46:44 PM (Process exited with code 2)

I am on Ubuntu 12.04 running Python 2.7.3. I have tried downloading and running with Python 2.7.5 however I kept getting a similar error to the one above, except with an ImportError saying that there was no module named zlib.

With this issue, I ran python 2.7.3 from terminal and tried importing zlib to which it worked, but when I tried the same with python 2.7.5 it failed being unable to find the zlib module.

I've been stuck on this issue for hours and could not find anything that could help me out.

Any help would be greatly appreciated, thanks!

Edit: Okay, I ran the development web server through the terminal instead of the Google App Engine Launcher and it worked perfectly.

I guess it's just a bug in the launcher.

回答1:

The option --admin_console_server= was removed but the launcher has not been updated to remove this option.

You can remove it yourself. From launcher/runtime.py remove the line '--admin_console_server=', (line 125 as of revision 9).



回答2:

unrecognized arguments: --admin_console_server=

there is no option --admin_console_server=.
you might want to change your dev_appserver.py flags to the ones listed in the error message



回答3:

This was solved for my by following the advice by Michael above, only to cause another error outlined here: 27463779: Unexpected keyword argument “context” when using appcfy.py

For that, the solution by dick_claus is the one I would recommend, this points to the following link: Google Engine Issue 11536: SDK is incompatible with python 2.7.9

Finally, it is possible to run the GoogleAppEngineLaunch.py script on a machine with python3 as default, by installing python2, and running with:

python2 GoogleAppEngineLaunch.py

For archlinux the package is python2 (for all subsidiary packages use python2-[name-of-subsidiary-package]).

However, you may have a conflict with wxpython, and for this I would try deleting/commenting out the lines that check for the version of wxpython. For me it was lines 28-33 that read.

REQUIRED_WX_VERSION = (2,8)
CURRENT_WX_VERSION = wx.VERSION[:2]
if CURRENT_WX_VERSION != REQUIRED_WX_VERSION:
    print >>sys.stderr, ('wxPython version incorrect; is %d.%d, must be %d.%d' % \
        (CURRENT_WX_VERSION + REQUIRED_WX_VERSION))
sys.exit(2)

If this helps, then please upvote dick_claus through the linked solution and Michael above as they gave the original solutions. However, I need Karma too, so...