Python successfully configured Scikit-learn with trial and error history

Source: Internet
Author: User
Tags install matplotlib

Required to go directly to the successful installation process

Trial and Error Course

I recently saw the Scikit-learn library, I think in Python called to do some testing, and so very convenient to start configuration, As a result of the previous installation of python2.7, it is intended to be configured in the previous version, from the online various posts to try the method, finally prompted to install the success, but in the run import Sklearn always error. So I started the hard-pressed Python rookie learning Station Road ....

For various fixes, I refer to the following posts:

1,http://blog.csdn.net/weiyidemaomao/article/details/8779728

Windows Use Pip installation Django

2,http://blog.csdn.net/licong_carp/article/details/43487101

Windows under Installation Pip Management Scikit-learn

3,http://blog.csdn.net/m53931422/article/details/42489897

-----------------------------------------------------Split Line-----------------------------------------------------------------

Thank the above bloggers for sharing, but, but,,,,,,,,,,,,,,,,,,,,, try various methods of patching, or run not right, finally burn your bridges and unload all the reload. The following will be the re-installation of the process to record, so that people can also appear in my previous troubled pot friends reference.

This time with the latest version of the python3.5.1 installed

For a basic installation of Python, refer to the blog

Http://www.tuicool.com/articles/eiM3Er3

follow the steps in this article to successfully install python (as I have tried, my friends have tried). After you have successfully installed python , start further configuration.

1. about numpy installation, directly in cmd pip install numpy, can be Installation numpy.

2. next pip install Djangan installation is successful, these can be in the Python3.5.1 Shell Whether the test was successful in c16>.


3. Install the scikit-learn.


Yes! Prompt succeeds. Hurry up and test if you can call correctly.


To be miserable ... importerror:no module named ' scipy '. You need to install scipyfirst.

4. Install the scipy. Direct pip install scipy will error, as shown in.



Analysis of the cause of the error, the three cipy package contains C Code, the installation needs to be based on the operating system used to compile, so different operating systems are installed differently. The following describes how to install the scipy package in the Windows operating system:

1) http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy in the Web page To download the precompiled installation package for the corresponding operating system, depending on whether the Python version is 2.x or 3.x, the system is a choice of four or four


Here's what I'm downloading. SCIPY-0.17.0-CP35-NONE-WIN32.WHL , and put the downloaded file into python under the installation directory scipts folder, my local words are F:\Python35\Scripts directory.

2) Install using pip Package Manager, advanced in cmd to store SCIPY-0.17.0-CP35-NONE-WIN32.WHL file in the directory, enter

Pipinstall Download scipy the path of the installation package (remember, be sure to enter the file name Ah, I was planted here again Ah, again made a mistake, such as Next, please around the pit)


The correct is:

At this time finally put NumPy and scipy are installed successfully, finally can carry out the installation of Scikit-learn.

5. Install the Scikit-learn.


Running Importsklearn or display fails in the compiler.


Error: Importerror : Dll load failed: the specified module could not be found, the description or Pip installation is not successful, then go directly to download Scikit-learn installation package, try the installation manually. download from the following website

http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy


Here because the version needs to be consistent, I downloaded the

SCIKIT_LEARN-0.17.1-CP35-CP35M-WIN32.WHL. Put the downloaded file in the Python installation directory under the Scipts folder, my native Word is the F:\Python35\Scripts directory

Install the following in cmd:


Import Sklearn in the compiler, fail again

>>>import Sklearn

Traceback (most recent):

File "<pyshell#3>", line 1,in <module>

Import Sklearn

File "F:\Python35\lib\site-packages\sklearn\__init__.py", line in<module>,

From. Base Import Clone

File "F:\Python35\lib\site-packages\sklearn\base.py", line 9, in<module>

From scipy Import Sparse

File "F:\Python35\lib\site-packages\scipy\sparse\__init__.py", line 214,in <module>

From. CSR Import *

File "F:\Python35\lib\site-packages\scipy\sparse\csr.py", line, in<module>

From. _sparsetools import CSR_TOCSC,CSR_TOBSR, csr_count_blocks, \

Importerror:dll load failed: The specified module could not be found.

find the cause again and see Scikit-learn  integratesclassic machine learning algorithms. Requires numpy+mkl.


Download


There will be a conflict after installing NUMPY-1.10.4+MKL-CP35-CP35M-WIN32.WHL

finally done, with Numpy-mkl Replace NumPy,,,,,,, The result is still not dripping .....

at this Import Sklearn It's not going to work, Nani. From scipyimport linalg will also be error:

No attribute ' Linalg '

..... It is really not bird ... Search under some netizens said is scipy version may not support the latest python3.5.1,and decided to completely reinstall python2.7.11. With a variety of previous trial and error experience, this time step by step carefully follow the steps to install

Correct installation processdownload the required files as follows
1, installation PYTHON2.7.112, installation pip-8.1.13. Install NumPy (pip install NUMPY-1.10.4+MKL-CP27-CP27M-WIN32.WHL)4. Install scipy (pip install SCIPY-0.17.0-CP27-NONE-WIN32.WHL)5. Install matplotlib (pip install MATPLOTLIB-1.5.1-CP27-NONE-WIN32.WHL)6. Install Scikit-learn (pip install SCIKIT_LEARN-0.17.1-CP27-CP27M-WIN32.WHL)
after these two days of trial and error, experienced a variety of head, the feeling has now passed all kinds of processes, and then install other Python-related package library should not be a problem

Python successfully configured Scikit-learn with trial and error history

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.