Error installing scikit-learn

When I try 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 solved?

+4
source share
5 answers

Are you a root user? Do you have administrator rights?

One of the methods:

$ sudo pip install scikit-learn

You will need to enter a password, and then it should work.

+17
source

One direct way to install scikit learn from scratch is to follow these steps:

1) install pip from https://pypi.python.org/pypi/pip/ or update your cmd using

python -m pip install -U pip setuptools

2) run

pip install wheel

3) numpy, scipy scikit http://www.lfd.uci.edu/~gohlke/pythonlibs/. (numpy + MKL scipy . python 32- 64- .

4) :

pip install numpy-1.12.1+mkl-cp36-cp36m-win_amd64.whl

pip install scipy-0.19.0-cp36-cp36m-win_amd64.whl

pip install scikit_learn-0.18.1-cp36-cp36m-win_amd64.whl

Scikit learn

5) python:

import numpy, scipy, sklearn

. . , .

+1
sudo pip install scikit-learn 

, virtualenv python.

1) virtualenv

[sudo] pip install virtualenv

2) / python.

virtualenv directory_name

3)

source directory_name/bin/activate

4) ,

pip install scikit-learn
0

download the whl file on this site http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn I downloaded 32-bit files and used pip installation

0
source

If you are an administrator,

1) Click "Start" and enter "cmd" (without quotes).

2) Right-click on the "cmd" icon and select "Run as administrator"

3) At the command prompt, enter "pip install scikit-learn".

0
source

All Articles