bash 找不到 appcfg.py 或 dev_appserver.py?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5187602/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cannot find appcfg.py or dev_appserver.py?
提问by Damian
My computer says...
我的电脑说...
"-bash: appcfg.py: command not found"
“-bash:appcfg.py:找不到命令”
What is wrong?
怎么了?
I can run my application using google-app-engine-launcher and I have python pre-installed.
我可以使用 google-app-engine-launcher 运行我的应用程序,并且我已经预装了 python。
I am trying to upload my app using "appcfg.py update myapp"
我正在尝试使用“appcfg.py update myapp”上传我的应用程序
I am new to Mac development.
我是 Mac 开发的新手。
回答by Calvin
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.
在 App Engine 启动器中,有一个名为“Make Symlinks...”的菜单选项,可为各种 App Engine 实用程序命令(如 appcfg.py)添加符号链接。
回答by Brice Lin
This is how my path dir looks like: Home/Brice/google_projects/google_appengine
这是我的路径目录的样子:Home/Brice/google_projects/google_appengine
I store both the google_appengineand my google_appsin my google_projectsfolder
我将google_appengine和google_apps都存储在我的google_projects文件夹中
In terminal: (While in my google_projects folder)
在终端中:(在我的 google_projects 文件夹中)
upload to localhost:
上传到本地主机:
google_appengine/dev_appserver.py appname
upload to GAE:
上传到 GAE:
google_appengine/appcfg.py update appname
and replace appname with the name of your app folder
并将 appname 替换为您的应用程序文件夹的名称
Hope that helps!
希望有帮助!
回答by pix
If someone (like me) comes across this more recently due to appcfg.pyand dev_appserver.pystill appearing frequently in the documentation:
如果有人(像我一样)最近由于appcfg.py并且dev_appserver.py仍然经常出现在文档中而遇到这个问题:
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 appcommand 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
0.9.68 (2015/07/08)
[...]
- 独立的 App Engine SDK 不再通过 Cloud SDK 分发。
- 仍可通过
gcloud preview app命令组使用 App Engine 功能 。- [...]
- 如果您需要直接使用 appcfg 或 dev_appserver,这些仍可在 App Engine SDK 下载中找到,可在此处找到:https: //cloud.google.com/appengine/downloads
(from google-cloud-sdk/RELEASE_NOTES)
(来自google-cloud-sdk/RELEASE_NOTES)
回答by tog22
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.
确保您已从https://cloud.google.com/appengine/downloads?csw=1安装 Google App Engine SDK/Launcher
在其中,选择“制作符号链接...”选项。“制作命令符号链接?” 当您第一次打开它或它自己更新后,可能会在对话框中弹出。
每次它自我更新时都必须这样做,否则它将停止工作。这通常是出错的地方。
回答by Peter Knego
Try: ./appcfg.py
尝试: ./appcfg.py
Current dir is usually not part of path.
当前目录通常不是路径的一部分。
回答by sleeplessnerd
If is not in a directory specified in the PATH environment variable and marked executable it wont execute by calling its plain name.
如果不在 PATH 环境变量中指定的目录中并标记为可执行文件,则不会通过调用其纯名称来执行。
when in doubt the following should always work:
如有疑问,以下内容应始终有效:
python /path/to/appcfg.py <your arguments>
回答by Digvijay Chougale
Using command line there are two options 1. make the two files executable and create symbolic links for them
使用命令行有两个选项 1. 使这两个文件可执行并为它们创建符号链接
# 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 .bashrcfile
2.导出PATH和PYTHONPATH变量。为此,在.bashrc文件中添加以下几行
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/"

