0

按照 Sphinx 主页上的说明,我打开一个命令窗口并输入:

C:\>easy_install -U Sphinx

(我假设升级的 -U 选项应该删除现有版本。)

我收到以下错误消息(我有管理员权限):

Creating c:\python32\lib\site-packages\site.py
Processing Sphinx
Running setup.py -q bdist_egg --dist-dir C:\Sphinx\egg-dist-tmp-tmopj5
error: Setup script exited with error: SandboxViolation: 
open('C:\\Python32\\lib\\lib2to3\\Grammar3.2.3.final.0.pickle', 'wb') {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.

谁能帮我理解和解决问题?请不要告诉我使用 pip,当我尝试使用以下方式安装 pip 时,我遇到了同样的错误:

C:\>easy_install pip

在此先感谢您的帮助。

4

1 回答 1

4

我在尝试安装请求库时遇到此错误消息。它似乎与构建期间未生成的文件有关(http://bugs.python.org/issue15822),但如果要使用 2to3 实用程序则需要这些文件。

对我来说,一个快速的解决方法是手动构建所需的腌制语法:

C:\Python33\Lib>..\python.exe -m lib2to3.pgen2.driver lib2to3\Grammar.txt
Generating grammar tables from lib2to3\Grammar.txt
Writing grammar tables to lib2to3\Grammar3.3.1.final.0.pickle

C:\Python33\Lib>..\python.exe -m lib2to3.pgen2.driver lib2to3\PatternGrammar.txt

Generating grammar tables from lib2to3\PatternGrammar.txt
Writing grammar tables to lib2to3\PatternGrammar3.3.1.final.0.pickle

我在 python 3.3.1 上对此进行了测试,但我相信同样的过程应该对你有用。

于 2013-04-08T19:45:16.463 回答