Mac OS X El Capitan (10.11) sudo pip install error "OSError: [Errno 1] Operation not permitted"

Source: Internet
Author: User
Tags virtualenv

Because OS X El Capitan uses System Integrity Protection protection technology, error is generated when sudo pip install installs Python packages:

1File"/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/os.py", line Max,inchmakedirs2Makedirs (Head, Mode)3File"/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/os.py", line157,inchmakedirs4     mkdir(name, mode)5OSError: [Errno1] Operation not permitted:'/system/library/frameworks/python.framework/versions/2.7/selenium'

SIP related command csrutil:

1xx:~$ csrutil2Usage:csrutil <command>3 Modify the System Integrity Protection configuration. All configuration changes apply to the entire machine.4 Available Commands:5 6     Clear7Clear the existing configuration. Only availableinchRecovery OS.8 Disable9Disable the protection on the machine. Only availableinchRecovery OS.Ten Enable OneEnable the protection on the machine. Only availableinchRecovery OS. A Status - Display the current configuration. -  the NetBoot -Add <address> -Insert a new IPV4 addressinchThe list of allowed NetBoot sources. - List + Print The list of allowed NetBoot sources. -Remove <address> +Remove an IPv4 address from the list of allowed NetBoot sources.

To view the current SIP status:

1 xx:~ $ csrutil Status2 System Integrity Protection status:enabled.

Path protected by sip:

    • /system
    • /usr
    • /bin
    • /sbin
    • OS X Pre-installed apps

If you need to install the Python package globally, you need to close SIP first, as follows:

1. Restart the system, hold option in the restart process and select recover partition

2, enter the recovery system, click the menu "Utility", open the terminal, enter Csrutil disable

3. Normal restart

4, sudo pip install XX package

5, after the installation is recommended to enter the recovery partition through the terminal open Sip:csrutil enable

It is also recommended to install virtualenvafter the SIP is closed and then open the SIP for subsequent environmental management through VIRTUALENV.

Reference Links:

http://stackoverflow.com/questions/33004708/osx-el-capitan-sudo-pip-install-oserror-errno-1-operation-not-permitted

Http://www.cnblogs.com/xiongqiangcs/p/4914049.html

https://support.apple.com/en-us/HT204899

Mac OS X El Capitan (10.11) sudo pip install error "OSError: [Errno 1] Operation not permitted"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.