2016-08-04 35 views
0

Ich versuche, für Python Scikit-Learn installieren 3. Ich kann es auf folgende Weise tun:Wie installiere ich scikit-learn für Python 3?

virtualenv model_env 
source model_env/bin/activate 
pip3 install sklearn 

Als Folge ich die folgende Fehlermeldung erhalten:

Downloading/unpacking sklearn 
    Cannot fetch index base URL https://pypi.python.org/simple/ 
    Could not find any downloads that satisfy the requirement sklearn 
Cleaning up... 
No distributions at all found for sklearn 

hatte ich das gleiche Problem mit pandas Paket und ich habe mit dem folgenden Befehl aufgelöst:

sudo apt-get install python3-pandas 

Leider ist der gleiche Ansatz nicht für die Arbeit sklearn

sudo apt-get install python3-sklearn 

ADDED

Wenn ich sklearn durch scikit-learn ersetzen, ich das gleiche Problem haben:

Downloading/unpacking scikit-learn 
    Cannot fetch index base URL https://pypi.python.org/simple/ 
    Could not find any downloads that satisfy the requirement scikit-learn 
Cleaning up... 
No distributions at all found for scikit-learn 

ADDED 2

Wie es empfohlen wurde, ich habe versucht, pip in combinati zu verwenden an mit -vvv. Beachten Sie, dass ich pip3 anstelle von pip verwende. Dies ist, was ich als das Ergebnis:

Downloading/unpacking scikit-learn 
    Getting page https://pypi.python.org/simple/scikit-learn/ 
    Could not fetch URL https://pypi.python.org/simple/scikit-learn/: connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/scikit-learn/ (Caused by <class 'OSError'>: [Errno 101] Network is unreachable) 
    Will skip URL https://pypi.python.org/simple/scikit-learn/ when looking for download links for scikit-learn 
    Getting page https://pypi.python.org/simple/ 
    Could not fetch URL https://pypi.python.org/simple/: connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/ (Caused by <class 'OSError'>: [Errno 101] Network is unreachable) 
    Will skip URL https://pypi.python.org/simple/ when looking for download links for scikit-learn 
    Cannot fetch index base URL https://pypi.python.org/simple/ 
    URLs to search for versions for scikit-learn: 
    * https://pypi.python.org/simple/scikit-learn/ 
    Getting page https://pypi.python.org/simple/scikit-learn/ 
    Could not fetch URL https://pypi.python.org/simple/scikit-learn/: connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/scikit-learn/ (Caused by <class 'OSError'>: [Errno 101] Network is unreachable) 
    Will skip URL https://pypi.python.org/simple/scikit-learn/ when looking for download links for scikit-learn 
    Could not find any downloads that satisfy the requirement scikit-learn 
Cleaning up... 
    Removing temporary dir /tmp/pip_build_root... 
No distributions at all found for scikit-learn 
Exception information: 
Traceback (most recent call last): 
    File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main 
    status = self.run(options, args) 
    File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 278, in run 
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) 
    File "/usr/lib/python3/dist-packages/pip/req.py", line 1178, in prepare_files 
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade) 
    File "/usr/lib/python3/dist-packages/pip/index.py", line 277, in find_requirement 
    raise DistributionNotFound('No distributions at all found for %s' % req) 
pip.exceptions.DistributionNotFound: No distributions at all found for scikit-learn 

Storing debug log for failure in /home/rngorb/.pip/pip.log 
+0

sudo pip installieren -U pip sudo pip installieren -U Scikit-Learn ist –

+1

Paketnamen – Luca

+0

@Luca Scikit-Learn, 'scikit-learn' nicht so gut funktioniert (das Update meiner Frage). – Roman

Antwort

5

Versuchen Sie es mit

pip3 install scikit-learn 
+0

Es hilft nicht, ich habe immer noch das gleiche Problem (die gleiche Fehlermeldung). – Roman

1

Vielleicht sollten Sie die Verwendung von Anaconda die standardmäßig beide Pakete umfassen betrachten und Ihr Leben einfach mit Werkzeugen machen zu verwalten enviroments und packages

+0

@Roman Ich habe auch gefunden, Anaconda zu verwenden, um der einfachste Weg zu sein, diese Pakete zu installieren. [Hier] (https://eatsleepdata.com/blogs/machine-learning/how-to-install-python-machine-learning-packings-using-anaconda) ist ein Beispiel für die Verwendung von Anaconda zur Installation von scikit-learn. –

0

Wenn Sie die Bequemlichkeit von Anaconda-Pakete, aber die Flexibilität und Minimalismus von pip Paket-Management wollen, empfehle ich Ihnen versuchen miniconda.

Sobald Sie miniconda installieren (wir erinnern uns an source ~/.bash_profile oder source ~/.bashrc), können Sie dies einrichten tun, um Ihre Umgebung:

conda create -n myenv scikit-learn pip python=3 

Dies wird Ihnen ein Conda env mit sklearn und Pip in Fall erhalten Sie wollen Bibliotheken installieren Diese werden nicht als Conda-Paket unterstützt. Der Pip läuft innerhalb der Conda env.

1

Erstes Update Ihr pip:

pip3 install --upgrade pip 

Dann installieren Sie mit ARG "--user" Scikit-Learn.Verwenden Sie keine sudo mit pip da es Probleme geben:

pip install --user scikit-learn 
0

, wenn Sie mehrere Python-Version haben, stellen Sie sicher, dass Sie an der richtigen Stelle-Paketpfad sind vor der Installation.

Es war der Fall für mich !!!