简体   繁体   English

尝试安装 Python 模块时,GCC 权限被拒绝

[英]GCC permission denied when trying to install Python module

I'm trying to install this module http://pypi.python.org/pypi/winrandom/1.1 .我正在尝试安装此模块http://pypi.python.org/pypi/winrandom/1.1 So I extract the content of the zip-file and try to install it with the command:因此,我提取了 zip 文件的内容并尝试使用以下命令进行安装:

python setup.py install

And receives this output:并收到此 output:

running install
running build
running build_ext
building 'winrandom' extension
c:\cygwin\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include 
-IC:\Python27\PC -c src/winrandom.c -o build\temp.win32-2.7\Release\src\winrandom.o
error: command 'gcc' failed: Permission denied¨

I have also tried with easy_install but am receiving the same error.我也尝试过easy_install,但收到了同样的错误。

The Python folders mentioned in the output are read-only and I suspect that it is what is causing the problem but I'm unable to change the read-only attribute. output 中提到的 Python 文件夹是只读的,我怀疑这是导致问题的原因,但我无法更改只读属性。

Edit: Also tried running as administrator编辑:也尝试以管理员身份运行

This problem may be caused by the fact that cygwin uses symlinks for gcc and g++, and windows doesn't understand how to handle this.这个问题可能是由于 cygwin 使用了 gcc 和 g++ 的符号链接,而 windows 不明白如何处理这个问题。 A quick test to see if this is so is as follows:一个快速测试看看是否是这样的如下:

C:\>g++
Access is denied.

C:\>bash

$ ls -l /usr/bin/g++
lrwxrwxrwx 1 nate Domain Users 21 Mar 22  2010 /usr/bin/g++ -> /etc/alternatives/g++

$ g++
g++: no input files

See this link and this question for more information about this problem.有关此问题的更多信息,请参阅此链接和此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM