python setup.py install - 失败,错误5:权限被拒绝

时间:2015-09-06 19:32:17

标签: windows python-2.7 cython setup.py

我在Windows 7下载了一个新软件包并尝试使用“python setup.py install -i”进行安装。 结果: [错误5]权限被拒绝

stackoverflow中的

Similar topic没有帮助:文件夹的权限设置正常。我给了所有用户完全访问权限。另见下文。

我的分析结果:“install”使用“build_ext”,导致错误

因此,我已经构建了一个非常小的示例来按以下顺序调试此错误:

1)我用2个文件创建目录 C:\ hello_world

helloworld.pyx

print "Hello World"

setup.py

from distutils.core import setup
from Cython.Build import cythonize
setup(
    ext_modules = cythonize("helloworld.pyx")
)

该目录拥有所有用户的完整权限。

2)然后我使用了以管理员模式执行的anaconda控制台(我也尝试了DOS框):

C:\hello_world>python setup.py build_ext -i

Compiling helloworld.pyx because it changed.
Cythonizing helloworld.pyx
running build_ext
building 'helloworld' extension
error: [Error 5] Zugriff verweigert  // translated: permission denied

构建失败。但是目录 C:\ hello_world 现在有三个文件,包括: helloworld.c ,内容合理。 这意味着:可以写入此目录。

3)我在文件build_ext.py中添加了一个log.info来找出pyd文件的存储位置:build_ext.py的第463行现在是: log.info("building '%s %s' extension", ext.name, ext_path)

anaconda控制台上的下一个试用版:

C:\hello_world>python setup.py build_ext -i

running build_ext
building 'helloworld C:\hello_world\helloworld.pyd' extension
error: [Error 5] Zugriff verweigert  // translated: permission denied

在这种状态下,我不知道该怎么做。我个人认为,错误5是由microsoft visual C ++发布的。

可以请别人帮忙吗?

P.S。:我使用的是Windows 7和.. Python 2.7.10, Anaconda 2.3.0(64位), Cython 0.22.1, setuptools 17.1.1, 用于Python 2.7的Microsoft Visual C ++编译器(由于vcvarsall.bat而需要)

0 个答案:

没有答案