在Windows 7上安装Python并分发后,系统会显示“写入失败...权限被拒绝". [英] Installing Python and distribute on Windows 7 gives "Writing failed ... permission denied"

查看:213
本文介绍了在Windows 7上安装Python并分发后,系统会显示“写入失败...权限被拒绝".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7上(我完全承认我不了解其权限模型.我在其他选项卡中对此有所了解.)我的用户是管理员.当我尝试运行"python Distribution_setup.py"时,出现写入失败...权限被拒绝"错误,然后出现错误:无法在安装目录中创建或删除文件".

I'm on Windows 7 (which I fully admit I don't understand the permissions model of. I'm reading about it in other tabs.) My user is an administrator. When I try to run "python distribute_setup.py" I get "writing failed ... permission denied" errors and then "error: can't create or remove files in install directory".

我刚从python.org安装了Python 3.2.2 MSI安装程序.

I've freshly installed the Python 3.2.2 MSI installer from python.org.

即使我在64位Windows上,我也正在安装32位Python,因为我将需要一些依赖项(pyglet,

I'm installing 32-bit Python even though I'm on 64 bit Windows, because I will have some dependencies that require it (pyglet, an OpenGL library.)

我下载了dispatch_setup.py并从命令行运行"python Distribution_setup.py".

I download distribute_setup.py and run "python distribute_setup.py" from the command-line.

在大量大量无用的文本中,这些喷出的内容是一些隐藏的错误消息:

Halfway through the massive amounts of useless text this spews are some hidden error messages:

root: Generating grammar tables from E:\Program Files (x86)\Python3.2.2\Lib\lib2to3\PatternGrammar.txt
root: Writing grammar tables to E:\Program Files (x86)\Python3.2.2\Lib\lib2to3\PatternGrammar3.2.2.final.0.pickle
root: Writing failed:[Errno 13] Permission denied: 'E:\\Program Files (x86)\\Python3.2.2\\Lib\\lib2to3\\PatternGrammar3.2.2.final.0.pickle'

这三行重复大约二十次,然后:

These three lines are repeated about twenty times, then:

Scanning installed packages
No setuptools distribution found
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: 'E:\\Program Files (x86)\\Python3.2.2\\Lib\\site-packages\\test-easy-install-5924.write-test'

目录"E:\ Program Files(x86)\ Python3.2.2 \ Lib"允许管理员完全控制".我的用户是管理员(并且选中的权限复选框全部变为灰色-即使我愿意,我也无法关闭完全控制"或任何其他权限.)

The directory "E:\Program Files (x86)\Python3.2.2\Lib" allows "full control" by administrators. My user is an administrator (and the checked permissions checkboxes are all greyed out - I couldn't turn off "full control" nor any other permissions even if I wanted to.)

我推测性地尝试将完全控制"添加到用户"组以及管理员"组.重新运行后,我不再遇到相同的错误,但是它在同一点退出,并带有:

I speculatively tried adding "full control" to the "Users" group as well as the "administrators" group. Rerunning, I no longer get the same errors, but it exits at the same point, with:

Scanning installed packages
No setuptools distribution found
build\src\setuptools\command\easy_install.py:289: UserWarning: Unbuilt egg for distribute [unknown version] (c:\users\jhartley\appdata\local\temp\tmpr0dzkz\distribute-0.6.24\build\src)
  self.local_index = Environment(self.shadow_path+sys.path)
warning: no files found matching 'Makefile' under directory 'docs'
warning: no files found matching 'indexsidebar.html' under directory 'docs'
error: E:\Program Files (x86)\Python3.2.2\Scripts: Access is denied

没有"E:\ Program Files(x86)\ Python3.2.2 \ Scripts"目录.我创建一个.它归管理员"所有,并为管理员设置了完全控制"权限.我注意到所有其他Python文件和目录均归"SYSTEM"所有.再次运行会给出:

There is no "E:\Program Files (x86)\Python3.2.2\Scripts" directory. I create one. It is owned by "administrators", and has "full control" set for administrators. I notice that all other Python files and directories are owned by "SYSTEM". Running again gives:

Scanning installed packages
No setuptools distribution found
build\src\setuptools\command\easy_install.py:289: UserWarning: Unbuilt egg for distribute [unknown version] (c:\users\jhartley\appdata\local\temp\tmp1kmbk6\distribute-0.6.24\build\src)
  self.local_index = Environment(self.shadow_path+sys.path)
warning: no files found matching 'Makefile' under directory 'docs'
warning: no files found matching 'indexsidebar.html' under directory 'docs'
error: E:\Program Files (x86)\Python3.2.2\Scripts\easy_install-script.py: Permission denied

即使'Scripts'目录具有授予管理员的'完全控制'权限,我还是尝试以推测方式为Users组添加'完全控制'权限.重新运行确实会产生一些警告:

Even though the 'Scripts' dir has 'full control' granted for administrators, I try speculatively adding 'full control' for Users group. Rerunning does produce some warnings:

Scanning installed packages
No setuptools distribution found
build\src\setuptools\command\easy_install.py:289: UserWarning: Unbuilt egg for distribute [unknown version] (c:\users\jhartley\appdata\local\temp\tmp31bznf\distribute-0.6.24\build\src)
  self.local_index = Environment(self.shadow_path+sys.path)
warning: no files found matching 'Makefile' under directory 'docs'
warning: no files found matching 'indexsidebar.html' under directory 'docs'

但似乎已成功完成.

但是,然后运行"easy_install virtualenv"会生成一个用户帐户控制"对话框是否要允许未知发行者的以下程序对此计算机进行更改?"然后创建一个新的CMD窗口,该窗口闪烁并消失得太快,以致于看不到它,但似乎无法正常工作:尚未安装virtualenv.

However, then running "easy_install virtualenv" produces a User Account Control dialog "Do you want to allow the following program from an unknown publisher to make changes to this computer?" and then creates a new CMD window, which flashes by and disappears too fast to see, and did not appear to work: virtualenv has not been installed.

我想阻止UAC对话框每次出现.这很烦人:"easy_install"是我信任的程序,不需要每次运行时都进行确认.我发现可以阻止UAC对话框出现的所有解决方案都涉及为可执行文件创建一个神奇的双击快捷方式.对于命令行应用程序,我还没有找到任何东西.

I'd like to stop the UAC dialog from appearing every time. It's annoying: "easy_install" is a program I trust, and I shouldn't need to confirm every time I run it. All of the solutions I can find to stop the UAC dialog from appearing involve creating a magic double-clickable shortcut to the executable. I haven't found anything for command-line applications.

我也想阻止easy_install在新的cmd窗口中启动.这使得看不到输出.这个问题似乎与UAC对话框无关,因为全局关闭UAC意味着easy_install将在没有对话框的情况下运行,但是它仍在新窗口中运行.

I'd also like to stop easy_install from launching in a new cmd window. This makes it impossible to see the output. This problem appears to be independent from the UAC dialog, because turning off UAC globally means easy_install will run without the dialog, but it still runs in a new window.

这是怎么回事?我在做什么错了?

What's going on here? What am I doing wrong?

推荐答案

似乎在打开命令提示符时必须使用以管理员身份运行"选项,因为正如您妻子所说,"Windows是f ** ** d".您似乎也已经发现,关闭UAC是避免这样做时避免获得UAC对话框的一种方法.

It seems that you have to use the "Run as administrator" option when opening the command prompt, because, as your wife says, "Windows is f****d". As you seem to also have discovered, turning off UAC is one way to avoid getting a UAC dialog when doing so.

这篇关于在Windows 7上安装Python并分发后,系统会显示“写入失败...权限被拒绝".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆