-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Description
Description
I am trying to install scikit-learn on my laptop using anaconda environment following the steps but once I go through the steps and do pytest sklearn, I get an error.
Steps/Code to Reproduce
I open anaconda promt and create new environment : conda create --name skleanwork
and activate it: conda activate sklearnwork
then i install numpy and scipy: conda install scipy; conda install numpy
then i run : conda install pytest
then i wanted to install developer environment so i install cython: conda install cython
then run: python setup.py install
I ran a check to see if it was installed correctly i installed pytest
then ran: pytest sklearn
which gave me an error
so i tried to put visual studio environment
SET DISTUTILS_USE_SDK=1
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
and run: python setup.py install
but gave me same error
Expected Results
Actual Results
(skleanwork) C:\Users\YANG\scikit-learn>pytest sklearn
================================================= test session starts =================================================
platform win32 -- Python 3.7.3, pytest-4.3.1, py-1.8.0, pluggy-0.9.0
rootdir: C:\Users\YANG\scikit-learn, inifile: setup.cfg
collected 0 items / 1 errors
======================================================= ERRORS ========================================================
__________________________________________________ ERROR collecting __________________________________________________
...conda\envs\skleanwork\lib\site-packages_pytest\config_init_.py:429: in _importconftest
return self._conftestpath2mod[conftestpath]
E KeyError: local('C:\Users\YANG\scikit-learn\sklearn\externals\conftest.py')
During handling of the above exception, another exception occurred:
sklearn_check_build_init.py:44: in
from ._check_build import check_build # noqa
E ModuleNotFoundError: No module named 'sklearn.__check_build._check_build'
During handling of the above exception, another exception occurred:
...conda\envs\skleanwork\lib\site-packages_pytest\config_init_.py:435: in importconftest
mod = conftestpath.pyimport()
...conda\envs\skleanwork\lib\site-packages\py_path\local.py:701: in pyimport
import(modname)
sklearn_init.py:75: in
from . import __check_build
sklearn_check_build_init.py:46: in
raise_build_error(e)
sklearn_check_build_init.py:41: in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
E ImportError: No module named 'sklearn.__check_build._check_build'
E ___________________________________________________________________________
E Contents of C:\Users\YANG\scikit-learn\sklearn__check_build:
E setup.py _check_build.c _check_build.pyx
E init.py pycache
E ___________________________________________________________________________
E It seems that scikit-learn has not been built correctly.
E
E If you have installed scikit-learn from source, please do not forget
E to build the package before using it: run python setup.py install or
E make in the source directory.
E
E If you have used an installer, please check that it is suited for your
E Python version, your operating system and your platform.
During handling of the above exception, another exception occurred:
...conda\envs\skleanwork\lib\site-packages\py_path\common.py:377: in visit
for x in Visitor(fil, rec, ignore, bf, sort).gen(self):
...conda\envs\skleanwork\lib\site-packages\py_path\common.py:418: in gen
dirs = self.optsort([p for p in entries
...conda\envs\skleanwork\lib\site-packages\py_path\common.py:419: in
if p.check(dir=1) and (rec is None or rec(p))])
...conda\envs\skleanwork\lib\site-packages_pytest\main.py:651: in recurse
ihook = self.gethookproxy(dirpath)
...conda\envs\skleanwork\lib\site-packages_pytest\main.py:472: in gethookproxy
my_conftestmodules = pm.getconftestmodules(fspath)
...conda\envs\skleanwork\lib\site-packages_pytest\config_init.py:413: in getconftestmodules
mod = self.importconftest(conftestpath.realpath())
...conda\envs\skleanwork\lib\site-packages_pytest\config_init.py:452: in importconftest
raise ConftestImportFailure(conftestpath, sys.exc_info())
E pytest.config.ConftestImportFailure: (local('C:\Users\YANG\scikit-learn\sklearn\externals\conftest.py'), (<class 'ImportError'>, ImportError("No module named 'sklearn.check_build.check_build'\n____________________________________________________________________\nContents of C:\Users\YANG\scikit-learn\sklearn\check_build:\nsetup.py check_build.c check_build.pyx\n__init.py pycache\n_________________________________________________________________________\nIt seems that scikit-learn has not been built correctly.\n\nIf you have installed scikit-learn from source, please do not forget\nto build the package before using it: run python setup.py install or\nmake in the source directory.\n\nIf you have used an installer, please check that it is suited for your\nPython version, your operating system and your platform."), <traceback object at 0x043EDC88>))
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================================== 1 error in 0.36 seconds ===============================================
Versions
windows
scipy 1.2.1
pytest 4.3.1
python 3.7.3 32 bit
numpy 1.16.2
cython 0.29.6
scikit-learn 0.21.dev0
(sorry the commands were not working so I did conda list to find the versions)