GAE - Flask - OSError:[Errno 13]路径无法访问:

时间:2012-07-14 12:18:30

标签: python google-app-engine flask

我正在尝试从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

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

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

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

1 个答案:

答案 0 :(得分:0)

我认为取得有关文件夹的所有权应该可以工作。我在Windows 10上遇到了相同的问题,必须在Powershell上执行此操作才能克服此问题。

。\ takeown.exe / f“ C:\ users \” / r / d y