当前位置: 首页 > 工具软件 > easy-sys > 使用案例 >

pythoninstall用不了_无法使用easy_install安装Python模块

章宏恺
2023-12-01

我试图使用easy_install来安装一个名为request的模块

easy_install requests

一周之前,当我使用Python 2.6.5时,这样工作正常,但是今天我安装了Python 2.7.2,然后尝试在我的一个脚本中导入请求,但是失败了.然后我尝试使用easy_install请求重新安装请求,但是收到此错误

install_dir /usr/local/lib/python2.6/dist-packages/

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: '/usr/local/lib/python2.6/dist-packages/test-easy-install-15207.pth'

The installation directory you specified (via --install-dir, --prefix, or

the distutils default setting) was:

/usr/local/lib/python2.6/dist-packages/

Perhaps your account does not have write access to this directory? If the

installation directory is a system-owned directory, you may need to sign in

as the administrator or "root" account. If you do not have administrative

access to this machine, you may wish to choose a different installation

directory, preferably one that is listed in your PYTHONPATH environment

variable.

For information on other options, you may wish to consult the

documentation at:

http://packages.python.org/distribute/easy_install.html

Please make the appropriate changes for your system and try again.

delete all setuptools*.egg and setuptools.pth files from your

system’s site-packages directory (and any other sys.path directories)

FIRST.

所以我做到了然后我从setuptools-0.6c11-py2.7.egg重新安装setuptools.这似乎是成功的,但是当我运行easy_install请求时,我得到基本相同的错误,除了目录python2.6 / dist-packages现在是python2.7 / site-packages

siddhion@siddhion-laptop:~$easy_install requests

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: '/usr/local/lib/python2.7/site-packages/test-easy-install-16253.write-test'

The installation directory you specified (via --install-dir, --prefix, or

the distutils default setting) was:

/usr/local/lib/python2.7/site-packages/

Perhaps your account does not have write access to this directory? If the

installation directory is a system-owned directory, you may need to sign in

as the administrator or "root" account. If you do not have administrative

access to this machine, you may wish to choose a different installation

directory, preferably one that is listed in your PYTHONPATH environment

variable.

For information on other options, you may wish to consult the

documentation at:

http://peak.telecommunity.com/EasyInstall.html

Please make the appropriate changes for your system and try again.

另外,当我做easy_install和按Tab键我得到这些选项

easy_install easy_install-2.6 easy_install-2.7

那么easy_install-2.6是怎么来的?

如何轻松安装再次工作?

 类似资料: