Jon*_*ley 2 python permissions install distribute windows-7
我在Windows 7上(我完全承认我不了解权限模型.我正在其他标签中阅读它.)我的用户是管理员.当我尝试运行"python distribute_setup.py"时,我得到"写入失败...权限被拒绝"错误然后"错误:无法创建或删除安装目录中的文件".
我刚从python.org安装了Python 3.2.2 MSI安装程序.
我正在安装32位Python,即使我在64位Windows上,因为我将有一些需要它的依赖项(pyglet,一个OpenGL库.)
我下载distribute_setup.py并从命令行运行"python distribute_setup.py".
在大量无用文本的中途,这个喷出了一些隐藏的错误消息:
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'
Run Code Online (Sandbox Code Playgroud)
这三行重复约二十次,然后:
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'
Run Code Online (Sandbox Code Playgroud)
目录"E:\ Program Files(x86)\ Python3.2.2\Lib"允许管理员"完全控制".我的用户是管理员(并且选中的权限复选框都是灰色的 - 即使我想,也无法关闭"完全控制"或任何其他权限.)
我推测尝试将"完全控制"添加到"用户"组以及"管理员"组.重新运行,我不再得到相同的错误,但它在同一点退出,具有:
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
Run Code Online (Sandbox Code Playgroud)
没有"E:\ Program Files(x86)\ Python3.2.2\Scripts"目录.我创造了一个.它由"管理员"拥有,并为管理员设置"完全控制".我注意到所有其他Python文件和目录都归"SYSTEM"所有.再次跑步给出:
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
Run Code Online (Sandbox Code Playgroud)
尽管'Scripts'目录已经为管理员授予了"完全控制权",但我还是试图为Users组添加"完全控制权".重新运行会产生一些警告:
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'
Run Code Online (Sandbox Code Playgroud)
但似乎成功完成.
但是,运行"easy_install virtualenv"会生成"用户帐户控制"对话框"是否要允许来自未知发布者的以下程序对此计算机进行更改?" 然后创建一个新的CMD窗口,它闪烁并消失得太快,看起来不起作用:还没有安装virtualenv.
我想阻止UAC对话每次都出现.这很烦人:"easy_install"是我信任的程序,每次运行它都不需要确认.我可以找到阻止UAC对话框出现的所有解决方案都涉及为可执行文件创建一个神奇的双击快捷方式.我还没有找到任何命令行应用程序.
我还想阻止easy_install在新的cmd窗口中启动.这使得无法看到输出.此问题似乎与UAC对话框无关,因为全局关闭UAC意味着easy_install将在没有对话框的情况下运行,但它仍然在新窗口中运行.
这里发生了什么?我究竟做错了什么?
在打开命令提示符时,您似乎必须使用"以管理员身份运行"选项,因为正如您的妻子所说,"Windows就是f****d".正如您似乎也发现的那样,关闭UAC是避免在执行此操作时获取UAC对话框的一种方法.
| 归档时间: |
|
| 查看次数: |
8665 次 |
| 最近记录: |