简体   繁体   English

点子不起作用(Mac)

[英]Pip doesn't work (Mac)

I am using python 3.6 and I have MAC OS X 10.12.6. 我正在使用python 3.6,并且具有MAC OS X 10.12.6。 I want to install packages like selenium and django. 我想安装selenium和django之类的软件包。 When I type pip install selenium it gives me this error 当我输入pip install selenium时,它给了我这个错误

OSError: [Errno 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/selenium' OSError:[Errno 1]不允许的操作:'/System/Library/Frameworks/Python.framework/Versions/2.7/selenium'

Does anyone know why this is happening? 有人知道为什么会这样吗? I am in the same directory as pip is installed. 我和pip安装在同一目录中。

This error shows when you are trying to overwrite macOS inbuilt Python packages, which is protected by macOS's System Integrity Protection (SIP). 当您尝试覆盖由macOS的系统完整性保护(SIP)保护的macOS内置Python软件包时,会显示此错误。

Since you are using Python 3 (which should be installed manually by you.), you should use pip3 , like so: 由于您使用的是Python 3(应由您手动安装),因此应使用pip3 ,如下所示:

pip3 install selenium

Seems as though the user you're using doesn't have permissions to write to that directory. 似乎您正在使用的用户没有写该目录的权限。 Instead of installing it system-wide, you could install the package for your own user: 您可以为自己的用户安装该软件包,而不必在系统范围内安装它:

$ pip install --user selenium

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM