【问题标题】:GAE - Flask - OSError: [Errno 13] path not accessible:GAE - Flask - OSError:[Errno 13] 路径不可访问:
【发布时间】:2012-07-14 01:59:10
【问题描述】:

我从 2 天以来一直在尝试让烧瓶运行,但是对于所有模板,我都会收到相同的错误消息

我使用的是 Windows 7 64 位

https://github.com/kamalgill/flask-appengine-template/

OOSError: [Errno 13] 路径不可访问:'c:\python27\dlls'

来自 pkq_resources,函数:find_on_path

所以我想这可能是 Windows 的问题,所以我将它部署到我的 GAE 应用程序中并且它工作正常。

http://kanta3d.appspot.com

但我不想每次都部署它,这会破坏工作流程。

我用谷歌搜索了这个错误,但找不到修复方法。

我做了一些调查,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

【问题讨论】:

  • 我也有同样的问题。在 Debian 上它可以工作,但在 Windows 上不行。
  • 那个目录真的存在吗?

标签: python google-app-engine flask


【解决方案1】:

我认为取得相关文件夹的所有权应该可行。我在 Windows 10 上遇到了同样的问题,我必须在 powershell 上这样做才能克服这个问题。

.\takeown.exe /f "C:\users\" /r /d y

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-21
    • 1970-01-01
    • 2021-11-06
    • 2014-07-15
    • 2015-09-14
    • 1970-01-01
    相关资源
    最近更新 更多