[英]Google App Engine Launcher Python Path
When I install the Google App Engine SDK and run the launcher, it asks me to configure the python location: 当我安装Google App Engine SDK并运行启动器时,它会要求我配置python位置:
And when I open Preferences
, it asks for a path to a python executable: 当我打开
Preferences
,它会询问python可执行文件的路径:
Which path should I insert and what is the difference: 我应该插入哪条路径,区别是什么:
Looks like Google App Engine couldn't find your python installation. 看起来Google App Engine无法找到您的python安装。 It looks for Python by checking the
PATH
environment variable, so it's best to use it. 它通过检查
PATH
环境变量来查找Python,因此最好使用它。
The short answer is use C:\\Python27\\pythonw.exe
. 简短的回答是使用
C:\\Python27\\pythonw.exe
。 I've just installed the latest "GoogleAppEngine-1.9.33.msi", and after I ran "Google App Engine launcher" ( C:\\Program Files (x86)\\Google\\google_appengine\\launcher\\GoogleAppEngineLauncher.exe
), in "Edit -> Preferences" I saw " C:\\Python35\\pythonw.exe
". 我刚刚安装了最新的“GoogleAppEngine-1.9.33.msi”,在我运行“Google App Engine启动器”(
C:\\Program Files (x86)\\Google\\google_appengine\\launcher\\GoogleAppEngineLauncher.exe
)后,“编辑 - >首选项“我看到了” C:\\Python35\\pythonw.exe
“。 (It is because I have Python 3.5 folder before Python 2.7 folder in my Path
environment variable setting.) But the point is App Engine launcher (or installer) chose the pythonw.exe
over python.exe
all by itself. (这是因为我在
Path
环境变量设置中的Python 2.7文件夹之前有Python 3.5文件夹。)但重点是App Engine启动器(或安装程序)选择pythonw.exe
不是python.exe
。
But as a better solution, I would suggest you to set your Path
environment variable, this will prevent other similar issues in the future. 但作为更好的解决方案,我建议您设置
Path
环境变量,这样可以防止将来出现其他类似问题。
To set Python on the Path
, if it's not set: 要在
Path
上设置Python,如果未设置:
C:\\Python27\\;C:\\Python27\\Scripts;
C:\\Python27\\;C:\\Python27\\Scripts;
to the beginning of the line. Alternatively in item 5, you might want to use user's PATH
from the upper list. 或者在第5项中,您可能希望从上面的列表中使用用户的
PATH
。 I would set Python for all users as I described. 我会按照我的描述为所有用户设置Python。
Now launch Google App Engine via "Google App Engine Launcher" and see if in "Edit -> Preferences" you have either "Default if not set: C:\\Python27\\pythonw.exe" or "Default if not set: C:\\Python27\\python.exe" written below the field for "Python path". 现在通过“Google App Engine Launcher”启动Google App Engine,看看在“编辑 - >首选项”中是否有“如果未设置则默认:C:\\ Python27 \\ pythonw.exe”或“如果未设置则默认:C:\\ Python27 \\ python.exe“写在”Python路径“字段下方。 If there's still nothing similar, then it's not the launcher that checks for
PATH
, but it's the Installer. 如果仍然没有类似的东西,那么它不是检查
PATH
的启动器,而是安装程序。 Then now it's time to uninstall "Google App Engine" and install it again. 然后现在是时候卸载“Google App Engine”并再次安装它。 After this everything should work as expected.
在此之后,一切都应该按预期工作。 (Btw, Installer checks for Python and other dependecies, so it should report if there're any errors.)
(顺便说一句,安装程序会检查Python和其他依赖项,因此它应该报告是否有任何错误。)
The main difference between python.exe
and pythonw.exe
is: python.exe
和pythonw.exe
的主要区别是:
python.exe
opens console widow when a module is executed with it, or, if run directly from command line, executes a module in a current console window preventing any further commands until the module exits. python.exe
在使用它执行模块时打开控制台窗口,或者,如果直接从命令行运行,则在当前控制台窗口中执行模块,防止任何进一步的命令,直到模块退出。 So basically intended for console applications or debugging. pythonw.exe
on the other hand is intended for GUI apps or no-GUI apps, so if a module is executed with pythonw.exe
, then there's no console window is open, if run via current console a module is executed in a separate process and the console is available for further commands right away. pythonw.exe
用于GUI应用程序或无GUI应用程序,因此如果使用pythonw.exe
执行模块,则没有打开控制台窗口,如果通过当前控制台运行,则模块在单独的进程中执行并且控制台可立即用于进一步的命令。 The drawback is no output is provided in this case, ie no errors printed as there's no console window associated with running Python module. Fore details see: official docs , chapter from a book(small but informative) , Python mailing list . 前面的详细信息请参阅: 官方文档 , 书中的章节(小但信息丰富) , Python邮件列表 。
Now regarding Google App Engine, on installation page they state: 现在关于Google App Engine,在安装页面上,他们说:
You will need Python 2.7 to use the App Engine SDK, because the Development Server is a Python application.
您将需要Python 2.7才能使用App Engine SDK,因为Development Server是一个Python应用程序。 Download Python 2.7.X (don't use a higher version) from the Python web site.
从Python网站下载Python 2.7.X(不要使用更高版本)。
So since a server is a no-GUI application, that's probably why App Engine chooses pythonw.exe
. 因此,由于服务器是一个无GUI应用程序,这可能是App Engine选择
pythonw.exe
。
According to this QA, pythonw seems to be preferable: https://code.google.com/p/googleappengine/issues/detail?id=11246 根据此QA,pythonw似乎更可取: https : //code.google.com/p/googleappengine/issues/detail? id = 11246
Here's the similiar question and answer: pythonw.exe or python.exe? 这是类似的问题和答案: pythonw.exe或python.exe?
python.exe is a console (terminal) application for launching CLI-type scripts.
python.exe是用于启动CLI类型脚本的控制台(终端)应用程序。
pythonw.exe is a GUI app for launching GUI/no-UI-at-all scripts.
pythonw.exe是一个GUI应用程序,用于启动GUI / no-UI-at-all脚本。
From looking at the the docs: https://docs.python.org/2/using/windows.html#executing-scripts 从查看文档: https : //docs.python.org/2/using/windows.html#executing-scripts
Pythonw basically suppresses the console window. Pythonw基本上抑制了控制台窗口。 I wouldn't think you'd need one using the app-engine, so, pythonw.exe would be my best guess.
我不认为你需要使用app-engine,因此,pythonw.exe将是我最好的猜测。
The error message says python=None
. 错误消息显示
python=None
。 Check if you can execute from cmd python -V
to confirm your python build is accessible throughout the system. 检查是否可以从cmd
python -V
执行以确认您的python构建是否可以在整个系统中访问。 GAE generally can find your python installation automatically, and confirms your python path before installation. GAE通常可以自动找到你的python安装,并在安装之前确认你的python路径。
Try this tutorial if its any help. 如果有任何帮助,请试用本教程 。
Pythonw.exe is the executable that does not open the console. Pythonw.exe是无法打开控制台的可执行文件。 Python.exe will open the console.
Python.exe将打开控制台。 You probably want to use pythonw.exe in this instance because I don't know why you would want a terminal open for the app engine.
您可能希望在此实例中使用pythonw.exe,因为我不知道您为什么要为应用程序引擎打开终端。
https://docs.python.org/2/using/windows.html https://docs.python.org/2/using/windows.html
The App Engine SDK also didn't find your installation of python. App Engine SDK也没有找到你的python安装。 This is probably because you don't have the global env.
这可能是因为你没有全球环境。 variable declared.
变量声明。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.