When I run:
sudo pip install ipython
I get the following error
OSError: [Errno: 1] Operation not permitted: "/System/Library/Frameworks/Python.framework/Versions/2.7/share"
The last command executed tries to create the directory given above.
Also, the following command fails to install iPython without providing any errors.
sudo pip install --user python
(I am on Mac OS X El Capitan in case other folks on this OS see the same issue.)
sudo pip install are inherently wrong.
If there is any tutorial out there which says you should do
sudo pip then please file a bug against this package. The author is dis-educating Python community, as time has proven
sudo pip to be a broken practice.
OSX El Capitan introduced a mechanisms to prevent damaging the operating system files.
/System/Library/Frameworks/Python.framework/Versions/2.7/share is one of the protected locations. A normal user has no reason to put or write any files there. This is because the operating system itself relies on these files and
sudo pip, with all force given from the above, would unconditionally overwrite them. Usually bad things would not happen, but the chances are there. Apple wants to protect their OS users to accidentally bricking their installation.
Instead, you need to install a Python package, like IPython, locally to the home folder of your user. The easiest way is to create a virtual environment, activate it and then run pip in the virtual environment.
cd ~ # Go to home directory virtualenv my-venv source my-venv/bin/activate pip install IPython
Alternatively, one should be able to do
pip install --user. But again, no sudo needed and you need to manually set up
PATH environment variable.
A Problem-Solver’s Guide to Building Real-World Intelligent Systems. Data is the new oil and Machine Learning is a powerful concept and framework for making the best out of it. In this age of aut...
Pandas 1.x Cookbook: Practical recipes for scientific computing, time series analysis, and exploratory data analysis using Python, 2nd Edition....
Cracking the Coding Interview PDF: 189 Programming Questions and Solutions, 6th Edition. I am not a recruiter. I am a software engineer. And as such, I know what it's like to be asked to create ing...
Introduction to Machine Learning with Python: A Guide for Data Scientists 1st Edition. Machine learning has become an integral part of many commercial applications and research projects, but this f...