dev_appserver.py打开文本文件,不进行部署

时间:2014-07-03 02:09:18

标签: python google-app-engine

它在我的其他计算机上工作正常,但在设置Google App Engine并创建main.py和app.yaml文件后,我在Windows命令提示符下运行dev_appserver.py app.yaml,而不是将应用程序部署到localhost: 8080它只是打开这个文本文件,我将缩短:

#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""Convenience wrapper for starting an appengine tool."""

import os
import sys

sys_path = sys.path
try:
  sys.path = [os.path.dirname(__file__)] + sys.path

  import wrapper_util

finally:
  sys.path = sys_path

wrapper_util.reject_old_python_versions((2, 7))

_DIR_PATH = wrapper_util.get_dir_path(__file__, os.path.join('lib', 'ipaddr'))
_PATHS = wrapper_util.Paths(_DIR_PATH)

等。等。

这里发生了什么?一切都与我的其他电脑完全相同。它应该工作。

3 个答案:

答案 0 :(得分:11)

解决了! .py文件全部设置为idle.bat,因此我必须进入Control Panel\Programs\Default Programs\Set Associations并将.py文件关联更改为python.exe。现在一切都像魅力一样。

答案 1 :(得分:2)

这台电脑上安装了Python吗?您所看到的是Windows不知道“.py”文件与Python相关联。

Installing SetupTools on 64-bit Windows可能会提供一些有用的信息。

答案 2 :(得分:0)

你应该向dev_appserver.py提供项目目录而不是app.yaml。 有关详细信息,请参阅GAE python hello world example。 让我们说你的项目 - Dir是

  

“/家/支/ GAEproejcts / myfirstproject”

并且您的dev_appserver.py位于

  

“/家/支/ GAEinstalldirectory /”

。 然后运行:

  

$ /home/rami/GAEinstalldirectory/dev_appserver.py   /家庭/支/ GAEproejcts / myfirstproject

这应该有效。