我从 2 天以来一直在尝试让烧瓶运行,但是对于所有模板,我都会收到相同的错误消息
我正在使用 Windows 7 64 位
https://github.com/kamalgill/flask-appengine-template/
OOSError:[Errno 13] 路径不可访问:'c:\python27\dlls'
来自 pkq_resources,功能:find_on_path
所以我想这可能是一个 Windows 的东西,所以我将它部署到我的 GAE 应用程序并且它工作。
但我不想每次都部署它,这会破坏工作流程。
我用谷歌搜索了这个错误,但找不到修复方法。
我做了一些调查,pkq_resources 中的这个函数抛出了错误
for entry in os.listdir(path_item): # this throws the error
.
def find_on_path(importer, path_item, only=False):
"""Yield distributions accessible on a sys.path directory"""
path_item = _normalize_cached(path_item)
if os.path.isdir(path_item) and os.access(path_item, os.R_OK):
if path_item.lower().endswith('.egg'):
# unpacked egg
yield Distribution.from_filename(
path_item, metadata=PathMetadata(
path_item, os.path.join(path_item,'EGG-INFO')
)
)
else:
# scan for .egg and .egg-info in directory
for entry in os.listdir(path_item):
lower = entry.lower()
if lower.endswith('.egg-info'):
fullpath = os.path.join(path_item, entry)
if os.path.isdir(fullpath):
# egg-info directory, allow getting metadata
metadata = PathMetadata(path_item, fullpath)
else:
metadata = FileMetadata(fullpath)
yield Distribution.from_location(
path_item,entry,metadata,precedence=DEVELOP_DIST
)
elif not only and lower.endswith('.egg'):
for dist in find_distributions(os.path.join(path_item, entry)):
yield dist
elif not only and lower.endswith('.egg-link'):
for line in open(os.path.join(path_item, entry)):
if not line.strip(): continue
for item in find_distributions(os.path.join(path_item,line.rstrip())):
yield item
break
完整来源:
https://github.com/kamalgill/flask-appengine-template/blob/master/src/pkg_resources.py