Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Não consigo instalar o pip install scikit-learn

Boa noite, sempre que executo o comando

pip install scikit-learn

da o seguinte error:

C:\Users\Eduardo>pip install scikit-learn
Collecting scikit-learn
  Using cached https://files.pythonhosted.org/packages/f5/2c/5edf2488897cad4fb8c4ace86369833552615bf264460ae4ef6e1f258982/scikit-learn-0.19.1.tar.gz
Building wheels for collected packages: scikit-learn
  Running setup.py bdist_wheel for scikit-learn ... error
  Complete output from command c:\users\eduardo\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Eduardo\\AppData\\Local\\Temp\\pip-install-h_inxevz\\scikit-learn\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\Eduardo\AppData\Local\Temp\pip-wheel-csa4vjyf --python-tag cp37:
  Partial import of sklearn during the build process.
  Traceback (most recent call last):
    File "C:\Users\Eduardo\AppData\Local\Temp\pip-install-h_inxevz\scikit-learn\setup.py", line 168, in get_numpy_status
      import numpy
  ModuleNotFoundError: No module named 'numpy'
  Traceback (most recent call last):
    File "C:\Users\Eduardo\AppData\Local\Temp\pip-install-h_inxevz\scikit-learn\setup.py", line 148, in get_scipy_status
      import scipy
  ModuleNotFoundError: No module named 'scipy'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\Eduardo\AppData\Local\Temp\pip-install-h_inxevz\scikit-learn\setup.py", line 269, in <module>
      setup_package()
    File "C:\Users\Eduardo\AppData\Local\Temp\pip-install-h_inxevz\scikit-learn\setup.py", line 249, in setup_package
      .format(numpy_req_str, instructions))
  ImportError: Numerical Python (NumPy) is not installed.
  scikit-learn requires NumPy >= 1.8.2.
  Installation instructions are available on the scikit-learn website: http://scikit-learn.org/stable/install.html


  ----------------------------------------
  Failed building wheel for scikit-learn
  Running setup.py clean for scikit-learn
Failed to build scikit-learn
Installing collected packages: scikit-learn
  Running setup.py install for scikit-learn ... error
    Complete output from command c:\users\eduardo\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Eduardo\\AppData\\Local\\Temp\\pip-install-h_inxevz\\scikit-learn\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Eduardo\AppData\Local\Temp\pip-record-vecteegh\install-record.txt --single-version-externally-managed --compile:
    Partial import of sklearn during the build process.
    Traceback (most recent call last):
      File "C:\Users\Eduardo\AppData\Local\Temp\pip-install-h_inxevz\scikit-learn\setup.py", line 168, in get_numpy_status
        import numpy
    ModuleNotFoundError: No module named 'numpy'
    Traceback (most recent call last):
      File "C:\Users\Eduardo\AppData\Local\Temp\pip-install-h_inxevz\scikit-learn\setup.py", line 148, in get_scipy_status
        import scipy
    ModuleNotFoundError: No module named 'scipy'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Eduardo\AppData\Local\Temp\pip-install-h_inxevz\scikit-learn\setup.py", line 269, in <module>
        setup_package()
      File "C:\Users\Eduardo\AppData\Local\Temp\pip-install-h_inxevz\scikit-learn\setup.py", line 249, in setup_package
        .format(numpy_req_str, instructions))
    ImportError: Numerical Python (NumPy) is not installed.
    scikit-learn requires NumPy >= 1.8.2.
    Installation instructions are available on the scikit-learn website: http://scikit-learn.org/stable/install.html


    ----------------------------------------
Command "c:\users\eduardo\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Eduardo\\AppData\\Local\\Temp\\pip-install-h_inxevz\\scikit-learn\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Eduardo\AppData\Local\Temp\pip-record-vecteegh\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Eduardo\AppData\Local\Temp\pip-install-h_inxevz\scikit-learn\

Já tentei usar

pip install numpy

deu um erro semelhante. Estou no momento baixando o conda para ver se resolve.

2 respostas

Oi Eduardo, tudo bem?

Você está utilizando o Python3? Se sim, você precisa instalar o numpy e o scipy antes de instalar a biblioteca do Scikit-learn.

Como você disse que já tentou instalar o Numpy e mesmo assim deu um erro, talvez seja o instalador que está com algum problema. Neste caso, recomendo desinstalar e instalar novamente.

solução!

Bom dia, desculpa a demora para responder. Tinha tentado fazer justamente isso que você falou Yuri, infelizmente não deu certo. Baixei o Miniconda e funcionou! Obrigado pela preocupação. qualquer duvida volto aqui no forum, até mais!