致命devappserver2错误:Appengine 1.7.6和1.7.5 python 2.7中的PYTHON_EGG_CACHE,win7

时间:2013-03-25 06:28:49

标签: google-app-engine windows-7 python-2.7

我尝试使用Appengine SDK 1.7.6版,但收到致命错误(如下所述),所以恢复到1.7.5,我的应用程序运行正常。但是,当我尝试在1.7.5中运行实验性devappserver时,我在1.7.6中看到的错误再次出现。我在win 7机器上运行Python 2.7。 AppEngine的标准安装选择。

这些错误消息是指与PYTHON_EGG_CACHE相关的权限,但是...... - 1)'old'dev_appserver不会出现它们 - 2)应用程序可以成功地将文件提取到指出的位置。实际上,我将PYTHON_EGG_CACHE的路径更改为另一个位置,赋予它全开权限,但仍然收到错误。 - 3)我的网站包里有pyyaml,所以不知道为什么它还需要做一个临时提取。

任何寻求解决方案的帮助都会受到赞赏,因为我将被迫在几个发布时间内使用新的devappserver。

下面的命令行错误转储:

python "C:\Program Files (x
86)\Google\google_appengine\devappserver2.py" .
WARNING  2013-03-25 19:10:41,029 devappserver2.py:497] devappserver2.py is curre
ntly experimental but will eventually replace dev_appserver.py in the App Engine
 Python SDK. For more information and to report bugs, please see: http://code.go
ogle.com/p/appengine-devappserver2-experiment/
INFO     2013-03-25 19:10:41,171 appcfg.py:618] Checking for updates to the SDK.

WARNING  2013-03-25 19:10:44,525 simple_search_stub.py:975] Could not read searc
h indexes from c:\users\ben\appdata\local\temp\appengine.dev~upskillme-main.Ben\
search_indexes
INFO     2013-03-25 19:10:44,539 api_server.py:148] Starting API server at: http
://localhost:49302
INFO     2013-03-25 19:10:44,555 dispatcher.py:96] Starting server "default" run
ning at: http://localhost:8080
INFO     2013-03-25 19:10:44,571 admin_server.py:112] Starting admin server at:
http://localhost:8000
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line
 150, in <module>
    run_file(__file__, globals())
  File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line
 146, in run_file
    execfile(script_path, globals_)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de
vappserver2\python\runtime.py", line 39, in <module>
    from google.appengine.ext.remote_api import remote_api_stub
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\remo
te_api\remote_api_stub.py", line 75, in <module>
    import yaml
  File "C:\Program Files (x86)\Google\google_appengine\lib\yaml-3.10\yaml\__init
__.py", line 14, in <module>
    from cyaml import *
  File "C:\Program Files (x86)\Google\google_appengine\lib\yaml-3.10\yaml\cyaml.
py", line 5, in <module>
    from _yaml import CParser, CEmitter
  File "C:\Python27\lib\site-packages\pyyaml-3.10-py2.7-win32.egg\_yaml.py", lin
e 7, in <module>
  File "C:\Python27\lib\site-packages\pyyaml-3.10-py2.7-win32.egg\_yaml.py", lin
e 4, in __bootstrap__
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 882, in resource_f
ilename
    self, resource_name
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 1351, in get_resou
rce_filename
    self._extract_resource(manager, self._eager_to_zip(name))
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 1406, in _extract_
resource
    manager.extraction_error()  # report a user-friendly error
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 928, in extraction
_error
    raise err
pkg_resources.ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

  [Error 5] Access is denied: 'C:\\Users\\Ben\\AppData\\Roaming\\Python-Eggs\\py
yaml-3.10-py2.7-win32.egg-tmp\\_yaml.pyd'

The Python egg cache directory is currently set to:

  C:\Users\Ben\AppData\Roaming\Python-Eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

Exception in thread Thread-4:
Traceback (most recent call last):
  File "C:\Python27\lib\threading.py", line 551, in __bootstrap_inner
    self.run()
  File "C:\Python27\lib\threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de
vappserver2\server.py", line 1045, in _loop_adjusting_instances
    self._adjust_instances()

1 个答案:

答案 0 :(得分:2)

如果有人出现同样的问题,那对我有用的解决方案如下:

  • 在python27站点包中解压缩PyYAML-3.10-py2.7-win32.egg 目录到site-packages中的新目录。你需要 将其解压缩到目录名称,如NEWPyYAML-3.10-py2.7-win32.egg 避免名称冲突。
  • 重命名原来的鸡蛋。到其他东西(例如,OLDPyYAML-3.10-py2.7-win32.egg)。
  • 将您的新目录重命名为PyYAML-3.10-py2.7-win32.egg

对egg的所有引用现在实际上都指向包含解压缩的python文件的site-packages中的目录。新的devappserver应该能够解决这个问题。

不确定如何在窗户中解压蛋?看到这里(假设您安装了Winzip或类似产品): http://mail.python.org/pipermail/chicago/2007-July/002301.html