How can I build scikit for training on windows?

When I run the installation of the script: python setup.py from cmd, I get the following error message:

ImportError: no module named sklearn._build_utils

After installation:

  • Python 2.7.2 64 bit for Windows
  • Enthought Canopy, which has sciPy, NumPy and matplotlib
  • Setuptools
  • scikit-learn-0.13.1.win32-py2.7
+4
source share
1 answer

If you are installing from a binary distribution, you should not try to build from the source. Just reinstall the binary packages for scikit-learn, and you should be able to import sklearn from your python shell.

Beware if you are using the Python installer from Canopy, you are probably better off using a canopy to install scikit-learn: https://www.enthought.com/products/canopy/package-index/ (although the current version available on the dome, a bit outdated: 0.11 instead of 0.13.1).

If you want to install scikit-learn for your own installation of Pythonn 2.7 from the Christoph Gohlke binary package repository, you must also install all the dependencies from the same repository (the scipy-stack meta-package should provide them all at once).

When in doubt, you can check which python you are working with:

 >>> import sys; print(sys.executable) 

to see the folder where python is installed. You can also specify the folders that python uses to search for packages:

 >>> print(sys.path) 

For scikit-learn or numpy you can do:

 >>> import sklearn; print(sklearn.__version__); print(sklearn.__path__) 

and

 >>> import numpy; print(numpy.__version__); print(numpy.__path__) 

Edit : now if you really want to build scikit-learn from the source (for example, to install the development branch from the github repository, you need to:

Change 2 typo fix: replace sys.__path__ with sys.executable .

+7
source

Source: https://habr.com/ru/post/1485373/


All Articles