When trying to install scikit-learn, I get the following error:
Exception:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/basecommand.py", line 232, in main
status = self.run(options, args)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/commands/install.py", line 347, in run
root=options.root_path,
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/req/req_set.py", line 543, in install
requirement.uninstall(auto_confirm=True)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/req/req_install.py", line 667, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/req/req_uninstall.py", line 126, in remove
renames(path, new_path)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/utils/__init__.py", line 316, in renames
shutil.move(old, new)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 300, in move
rmtree(src)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 250, in rmtree
os.remove(fullname)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/numpy-1.8.0-py2.7.egg-info/dependency_links.txt'
How can this be resolved?
If you are the admin,
1) Click on “Start” and type “cmd” (without the quotations).
2)Right Click on the “cmd” icon and select “Run as Administrator”
3)Type "pip install scikit-learn" in command prompt.
Actually, I was facing the same problem in windows10 recently for python3 then I try this it worked for me.
This would solve your issue but I would recommend you to install virtualenv for python projects.
1) Install virtualenv
2) Go to your project directory and create virtual environment / isolated environment for python project
3) Activate virtual environment
4) Install whatever you want
download the file whl in this site http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn I did download the 32bit files and use the pip install
Are you the root user? Do you have admin privileges?
One way you be to do:
You will need to type your password and then it should work.
One straight way to install scikit learn from scratch is following the below steps:
1) install pip from https://pypi.python.org/pypi/pip/ or upgrade in your cmd using
2) run
3) download the numpy, scipy & scikit learn files from http://www.lfd.uci.edu/~gohlke/pythonlibs/. (numpy+MKL & scipy modules. Check for your python version and 32 bit or 64 bit CPU.
4) run these in your command prompt:
You are ready to play with Scikit learn
5) run this in your python shell:
Note: I saw several articles on building from source on windows. You don't have to build from source for binary wheel files that you installed from the above link on your windows.