0

I'm trying to run the dev_appserver.py command from windows powershell (I'm doing it inside the folder where I have a appl.yaml and main.py file). I'm running it with the following command:

python "C:\Users\Dachshund\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\dev_appserver.py"

and it gives me the error message

dev_appserver.py: error: too few arguments.

Below is the full detail of what runs after I input the command. Any help would be very appreciated.

PS C:\Users\Dachshund\Desktop\helloworld> python "C:\Users\Dachshund\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\dev_appserver.py"
usage: dev_appserver.py [-h] [-A APP_ID] [--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]]
                        [--threadsafe_override THREADSAFE_OVERRIDE]
                        [--php_executable_path PATH]
                        [--php_remote_debugging [PHP_REMOTE_DEBUGGING]]
                        [--php_gae_extension_path PATH]
                        [--php_xdebug_extension_path PATH]
                        [--appidentity_email_address APPIDENTITY_EMAIL_ADDRESS]
                        [--appidentity_private_key_path APPIDENTITY_PRIVATE_KEY_PATH]
                        [--python_startup_script PYTHON_STARTUP_SCRIPT]
                        [--python_startup_args PYTHON_STARTUP_ARGS]
                        [--jvm_flag JVM_FLAG] [--go_work_dir GO_WORK_DIR]
                        [--custom_entrypoint CUSTOM_ENTRYPOINT]
                        [--runtime RUNTIME] [--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]
                        [--smtp_allow_tls [SMTP_ALLOW_TLS]]
                        [--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] [--grpc_api GRPC_APIS]
                        [--grpc_api_port GRPC_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]
                        [--env_var ENV_VARIABLES]
                        [--google_analytics_client_id GOOGLE_ANALYTICS_CLIENT_ID]
                        [--google_analytics_user_agent GOOGLE_ANALYTICS_USER_AGENT]
                        yaml_path [yaml_path ...]
dev_appserver.py: error: too few arguments
CDspace
  • 2,639
  • 18
  • 30
  • 36
Dachshund
  • 1
  • 2
  • Possible duplicate of [dev\_appserver.py Opens a Text File, Does Not Deploy](http://stackoverflow.com/questions/24543883/dev-appserver-py-opens-a-text-file-does-not-deploy) – Dan Cornilescu Apr 04 '17 at 16:58
  • Yes, I had already seen that post and tried all the solutions but nothing works. – Dachshund Apr 04 '17 at 18:26
  • do you have python 2.7 installed? Is it the default app mapped to .py files? – Dan Cornilescu Apr 04 '17 at 18:38
  • I do have 2.7 installed (I've actually run python programs directly in powershell with no issues, it's just using appengine that has been a pain). Default mapping of .py files was actually set to notepad, so I changed it to Python and it still doesn't work. I just tried running it with the following command: python "C:\Users\Dachshund\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\dev_appserver.py" and it says "dev_appserver.py: error: too few arguments". Any thoughts? – Dachshund Apr 04 '17 at 19:33
  • Much better - that was your problem, as in the duplicate - at least the server is now launched. OK, now add the app's .yaml file(s) as arguments and whatever else you need. – Dan Cornilescu Apr 04 '17 at 21:51
  • Finally was able to make it work. There was actually a formatting problem in my app.yaml file. Incredible how long it took to figure that out. Thanks so much! – Dachshund Apr 05 '17 at 00:41
  • @Dachshund I can see you have resolved the issue, consider posting a self-answer to help future readers and to close out the question. – Faizan Aug 17 '17 at 15:10

1 Answers1

1

You must specify the app.yaml or the directory that contains it explicitly:

python "C:\Users\Dachshund\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\dev_appserver.py" app.yaml

Or just:

python "C:\Users\Dachshund\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\dev_appserver.py" .

On the other hand, if you just run dev_appserver.py app.yaml on Windows you may also get that error because the arguments are not passed when using the file association, call it always with python to avoid trouble.

Marc Climent
  • 9,434
  • 2
  • 50
  • 55