macos 尝试在 OSX 上安装 easy_install 时权限被拒绝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4416984/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 07:26:03  来源:igfitidea点击:

Permission denied when trying to install easy_install on OSX

pythonmacosinstallationeasy-install

提问by mrdavidjcole

I'm trying to install easy_install and, well... see for yourself:

我正在尝试安装 easy_install 并且,嗯......你自己看看:



sh setuptools-0.6c11-py2.6.egg

sh setuptools-0.6c11-py2.6.egg

Processing setuptools-0.6c11-py2.6.egg

处理 setuptools-0.6c11-py2.6.egg

Copying setuptools-0.6c11-py2.6.egg to /Library/Python/2.6/site-packages

将 setuptools-0.6c11-py2.6.egg 复制到 /Library/Python/2.6/site-packages

Adding setuptools 0.6c11 to easy-install.pth file

将 setuptools 0.6c11 添加到 easy-install.pth 文件

Installing easy_install script to /usr/local/bin

将 easy_install 脚本安装到 /usr/local/bin

error: /usr/local/bin/easy_install: Permission denied

错误:/usr/local/bin/easy_install:权限被拒绝



How do I give my computer permission to do this? I tried telling it in a friendly voice, "computer, I hereby grant you permission to install easy_install" but that didn't work.

我如何授予我的计算机执行此操作的权限?我试着用友好的声音告诉它,“计算机,我特此授予您安装easy_install的权限”,但这没有用。

采纳答案by robert

Use sudo.

使用sudo

sudo sh setuptools-0.6c11-py2.6.egg

I would also investigate MacPorts.

我也会调查MacPorts

Edit (5 years later): I now suggest Homebrewinstead of MacPorts.

编辑(5 年后):我现在建议使用Homebrew而不是 MacPorts。

回答by Nerian

sudo sh setuptools-0.6c11-py2.6.egg

回答by Pulkit Sinha

You should use sudo . You will need to enter your password.

你应该使用 sudo 。您将需要输入密码。

回答by Ned Deily

Judging from the paths displayed, you are likely using the Apple-supplied Python 2.6 in OS X 10.6. If so, be aware that Apple has already easily installed easy_installfor you in /usr/bin. Just try typing easy_install; you may need to use sudo easy_installif the package tries to install a script. If you are using another Python (one you installed yourself), you will need to install a separate version of setuptools(or the newer Distribute) for it.

从显示的路径来看,您很可能在 OS X 10.6 中使用 Apple 提供的 Python 2.6。如果是这样,请注意 Apple 已经easy_install为您轻松安装了/usr/bin. 试试打字吧easy_installsudo easy_install如果软件包尝试安装脚本,您可能需要使用它。如果你正在使用另一个 Python(你自己安装的),你需要为它安装一个单独的setuptools(或更新的Distribute)版本。