gpt4 book ai didi

python - "Can' t 提取文件到 egg 缓存“GAE 中的错误

转载 作者:行者123 更新时间:2023-11-28 21:54:27 25 4
gpt4 key购买 nike

我有安装了 setuptools 的 Windows 7 和 Python 2.7。

在我下载 pitz 模块 (easy_install pitz) 后,Google App Engine 停止工作:

bad runtime process port ['']

Traceback (most recent call last):
File "G:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line 184, in <module>
_run_file(__file__, globals())
File "G:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line 180, in _run_file
execfile(script_path, globals_)
File "G:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\runtime.py", line 28, in <module>
from google.appengine.ext.remote_api import remote_api_stub
File "G:\Program Files (x86)\Google\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 75, in <module>
import yaml
File "G:\Program Files (x86)\Google\google_appengine\lib\yaml-3.10\yaml\__init__.py", line 14, in <module>
from cyaml import *
File "G:\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.11-py2.7-win-amd64.egg\_yaml.py", line 7, in <module>
File "C:\Python27\lib\site-packages\pyyaml-3.11-py2.7-win-amd64.egg\_yaml.py", line 4, in __bootstrap__
File "C:\Python27\lib\site-packages\pkg_resources.py", line 950, in resource_filename
self, resource_name
File "C:\Python27\lib\site-packages\pkg_resources.py", line 1607, in get_resource_filename
self._extract_resource(manager, self._eager_to_zip(name))
File "C:\Python27\lib\site-packages\pkg_resources.py", line 1667, in _extract_resource
manager.extraction_error()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 996, 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] : 'C:\\Users\\Kostr\\AppData\\Roaming\\Python-Eggs\\pyyaml-3.11-py2.7-win-amd64.egg-tmp\\_yaml.pyd'

The Python egg cache directory is currently set to:

C:\Users\Kostr\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.

如何解决这个问题?

最佳答案

来自:https://code.google.com/p/modwsgi/wiki/ApplicationIssues

要避免这个特殊问题,您可以在 WSGI 应用程序脚本文件的开头设置 PYTHON_EGG_CACHE 缓存环境变量。环境变量应设置为由运行 Apache 的用户拥有和/或可写的目录。

import os
os.environ['PYTHON_EGG_CACHE'] = '/usr/local/pylons/python-eggs'

再次确保它存在。对于 Windows 用户,可能是这样的:

os.environ['PYTHON_EGG_CACHE'] = '/tmp'

或者,如果使用 mod_wsgi 2.0,还可以对在嵌入式模式下运行的应用程序使用 WSGIPythonEggs 指令,或者在使用守护程序模式时对 WSGIDaemonProcess 指令使用 python-eggs 选项。

请注意,您应该避免使用任何人都可写的目录或文件,因为这可能会危及安全。还要注意,如果在同一 Web 服务器下托管多个应用程序,它们将以同一用户身份运行,因此每个应用程序都可以查看和修改彼此的文件。如果这是一个问题,您应该将应用程序托管在以不同用户或不同系统运行的不同 Web 服务器上。或者,应用程序所需或更新的任何数据都应托管在数据库中,每个应用程序都有单独的帐户。

关于python - "Can' t 提取文件到 egg 缓存“GAE 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24230950/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com