尝试安装python软件包时,Mac终端上的“不允许操作”

我正在尝试使用以下代码行在python上安装软件包:

git clone https://github.com/dartoon/decomprofile
cd decomprofile
python setup.py develop

直到最后一步,它都会返回错误消息:

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: '/library/Python/2.7/site-packages/test-easy-install-53720.write-test'

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

    /library/Python/2.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:

  https://setuptools.readthedocs.io/en/latest/easy_install.html

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

我是计算机的管理员,所以我不知道为什么我没有更改文件的权限。我还要确保我也具有“全盘访问”权限。我已经尝试过命令

sudo easy_install

但是这也不起作用。我在Mac OS Catalina上的终端应用程序中工作。我最近更新到anaconda3并使用Python 3.8,所以我不确定为什么目录显示为2.7 —我可以删除此目录吗?

aa1123128 回答:尝试安装python软件包时,Mac终端上的“不允许操作”

默认情况下,macOS预先安装了python2.7。 Catalina还预装了python3.7。尝试使用python3而非python命令。

您无法删除python 2.7,因为它是系统依赖项。

本文链接:https://www.f2er.com/1408255.html

大家都在问