Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/356.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 错误:can';t在安装目录中创建或删除文件_Python - Fatal编程技术网

Python 错误:can';t在安装目录中创建或删除文件

Python 错误:can';t在安装目录中创建或删除文件,python,Python,我正试图按照本页Unix(wget)部分的指示设置工具 但是每当我运行这个命令时,我都会遇到以下错误 wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python 错误消息: --2014-04-19 17:29:52-- https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py Resolving bitbucket

我正试图按照本页Unix(wget)部分的指示设置工具

但是每当我运行这个命令时,我都会遇到以下错误

wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
错误消息:

--2014-04-19 17:29:52--  https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
Resolving bitbucket.org (bitbucket.org)... 131.103.20.167, 131.103.20.168
Connecting to bitbucket.org (bitbucket.org)|131.103.20.167|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10332 (10K) [text/plain]
Saving to: `STDOUT'

100%[======================================>] 10,332      --.-K/s   in 0s      

2014-04-19 17:29:53 (267 MB/s) - written to stdout [10332/10332]

Extracting in /tmp/tmpDXrlBn
Now working in /tmp/tmpDXrlBn/setuptools-3.4.4
Installing Setuptools
running install
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/dist-packages/test-easy-install-    19015.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

/usr/local/lib/python2.7/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:

   https://pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.
在浏览解决方案时,我发现 sudo简易安装
或者改变蟒蛇可能会奏效。我需要一个相对详细的解决方案,因为我两个都不能工作。提前感谢。

答案在错误消息中

/usr/local/lib/python2.7/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.

如果在运行命令之前运行
sudo su
,它应该可以工作。

答案在错误消息中

/usr/local/lib/python2.7/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.

如果在运行命令之前运行
sudo su
,它应该可以工作。

这对任何人来说都是一个危险信号。如果您正在以自己的用户身份在自己的目录中安装某些内容,并且该目录为read/write/exec,则此工具不需要root权限才能运行,除非它在system directories=BAD中安装某些内容

如果你下载了一些东西并得到了这个,我建议你在运行sudo安装之前彻底检查一下代码。如果您不了解这一点,那么不要运行sudo来强制安装它。此外,在某些平台上,如果安装到系统目录,可能会覆盖或破坏现有的依赖关系,并破坏您的系统。MAC在这方面尤其糟糕

我建议您研究一些替代方案: 1.每用户站点包- 2.VirtualENV-允许您克隆系统python,这样您就不会干扰它。
3.查看源代码。如果存在某些依赖项,可能您可以单独预安装,然后重新运行脚本。

这对任何人来说都是一个危险信号。如果您正在以自己的用户身份在自己的目录中安装某些内容,并且该目录为read/write/exec,则此工具不需要root权限才能运行,除非它在system directories=BAD中安装某些内容

如果你下载了一些东西并得到了这个,我建议你在运行sudo安装之前彻底检查一下代码。如果您不了解这一点,那么不要运行sudo来强制安装它。此外,在某些平台上,如果安装到系统目录,可能会覆盖或破坏现有的依赖关系,并破坏您的系统。MAC在这方面尤其糟糕

我建议您研究一些替代方案: 1.每用户站点包- 2.VirtualENV-允许您克隆系统python,这样您就不会干扰它。
3.查看源代码。如果存在某些依赖项,您可以单独预安装,然后重新运行脚本。

错误消息包含您必须知道的所有信息。您可以始终安装到。错误消息包含您必须知道的所有信息。您可以始终安装到。