Cannot find appcfg.py or dev_appserver.py?

2020-03-11 02:36发布

My computer says...

"-bash: appcfg.py: command not found"

What is wrong?

I can run my application using google-app-engine-launcher and I have python pre-installed.

I am trying to upload my app using "appcfg.py update myapp"

I am new to Mac development.

7条回答
再贱就再见
2楼-- · 2020-03-11 03:06

If someone (like me) comes across this more recently due to appcfg.py and dev_appserver.py still appearing frequently in the documentation:

0.9.68 (2015/07/08)

[...]

  • The standalone App Engine SDKs are no longer distributed through the Cloud SDK.
    • App Engine functionality can still be used through the gcloud preview app command group.
    • [...]
    • If you need to use appcfg or dev_appserver directly, these are still available in the App Engine SDK downloads that can be found here: https://cloud.google.com/appengine/downloads

(from google-cloud-sdk/RELEASE_NOTES)

查看更多
萌系小妹纸
3楼-- · 2020-03-11 03:12

In App Engine launcher there is a menu option called "Make Symlinks..." that adds symlinks for the various App Engine utility commands, like appcfg.py.

查看更多
爷的心禁止访问
4楼-- · 2020-03-11 03:12

Because the top-voted and accepted answer doesn't explain this, and not everyone will read the comments on it, here's what to do:

  • Ensure you've installed Google App Engine SDK/Launcher from https://cloud.google.com/appengine/downloads?csw=1

  • Within it, select the option to "Make Symlinks...". "Make Command Symlinks?" may pop up in a dialog when you open it for the first time or after it's updated itself.

  • You'll have to do this each time it updates itself or it'll stop working. This is often what's gone wrong.

查看更多
可以哭但决不认输i
5楼-- · 2020-03-11 03:14

Try: ./appcfg.py

Current dir is usually not part of path.

查看更多
Emotional °昔
6楼-- · 2020-03-11 03:27

If is not in a directory specified in the PATH environment variable and marked executable it wont execute by calling its plain name.

when in doubt the following should always work:

python /path/to/appcfg.py <your arguments>
查看更多
放我归山
7楼-- · 2020-03-11 03:27

Using command line there are two options 1. make the two files executable and create symbolic links for them

# chmod +x path/to/google_appengine/dev_appserver.py
# ln -s /path/to/google_appengine/dev_appserver.py /bin
# chmod +x path/to/google_appengine/appcfg.py
# ln -s /path/to/google_appengine/appcfg.py /bin

2. export PATH and PYTHONPATH variables. To do this add following lines in .bashrc file

export PATH=$PATH:/path/to/google_appengine/
export PYTHONPATH="$PYTHONPATH:/path/to/google_appengine:/path/to/google_appengine/‌​lib/:/path/to/google_appengine/lib/yaml/"
查看更多
登录 后发表回答