Python&BeautifulSoup设置不工作

2024-04-25 01:27:30 发布

您现在位置:Python中文网/ 问答频道 /正文

无法在我的计算机上安装BeautifulSoup,它继续告诉我我没有可写访问权限?见下文:

Last login: Fri Jun 26 14:08:26 on ttys000
Britneys-MacBook-Air:~ Pryde$ pip install requests
-bash: pip: command not found
Britneys-MacBook-Air:~ Pryde$ 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: '/Library/Python/2.7/site-packages/test-easy-install-19650.pth'

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.

如有任何反馈,我们将不胜感激。-谢谢!在


Tags: installpiporthetoinyounot
1条回答
网友
1楼 · 发布于 2024-04-25 01:27:30

在Mac上使用pip安装时,您需要以sudo的身份运行该命令(如果您想要对sudo的操作给出一个非常糟糕的解释,它将提示您输入密码)。在

sudo pip install requests

这将解决你的可写访问。然而,正如另一张海报所说,你是在处理请求,而不是美化团队。这同样适用于sudo。在

pip list和其他非安装/修改pip子命令可以在没有sudo的情况下正常运行。在

更新:您似乎还没有安装pip。我的错,我没有发现,因为您粘贴了pip安装,遇到了一个错误,但随后尝试了轻松安装,大部分消息都与easy install有关。在

这个链接解释了如何安装pip。install pip on mac。再次注意sudo。一旦成功,您就可以重新尝试第一次sudo pip安装请求。在

您可能想这样做,因为pip通常比简单的简单安装更聪明。在

相关问题 更多 >