我正在尝试安装安装工具。当我运行“sh setuptools-0.6c9-py2.4.egg”时,会收到以下消息:Permission denied:
'/usr/lib/python2.4/site-packages/test-easy-install-26338.write-test'
这是可以预期的,因为我没有系统的根权限。我是如何想到创建一个“虚拟”Python的。
我下载“virtual python.py”并使用站点范围的python运行它。它在主目录中创建“lib”、“bin”和“include”子目录。在“virtual python.py”输出的末尾,我看到以下消息:You're now ready to download
ez_setup.py, and run
/home/myname/bin/python ez_setup.py
我下载这个文件并运行它。但是我得到了同样的错误信息:Permission denied:
'/usr/lib/python2.4/site-packages/test-easy-install-925.write-test'
好的。我使用“prefix”强制ez_setup.py写入本地目录:/home/myname/bin/python ez_setup.py --prefix=~
然后我得到:You can set up the installation directory to support ".pth" files by
using one of the approaches described
here:
所以,我被重定向到以前读过的同一页。所以,我现在不知道该怎么办。
我还有一个提示:You can add the installation directory to the PYTHONPATH
environment variable. (It must then
also be on PYTHONPATH whenever you run
Python and want to use the package(s)
you are installing.)
但如果我输入:PYTHONPATH=/home/myname/lib/python2.4/site-packages
如果Python看不到我的环境变量,我仍然得到相同的结果。
有人能帮我吗?