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

Problema instalação pip

Não consegui instalar o pip. Baixei o Python 3.6 no site do python.org , mas quando digito os comandos que o professor fala no vídeo, da erro

3 respostas

Oi Lucas, tudo bem? Pode mandar o erro que está aparecendo?

Lembrando que versões mais recentes do python pode apresentar algumas diferenças nas quais foram feitas no curso, por isso é recomendado que utilize a mesma versão vista em curso, pois conforme as bibliotecas vão sendo atualizadas, algumas APIs podem mudar.

Abraços.

Obrigado por responder Alex.

Correção: O erro acontece na hora de instalar o scikit-learn

Informaçoes adicionais: SO= windows

Passos:

Baixei o o python 3.6.0 no site https://www.python.org/ e o arquivo no site http://pip.readthedocs.io/ na pasta de downloads

Instalei o python 3.6.0 no meu disco D:/

Pelo cmd(executado como administrador), fui até a pasta

Executei o comando "python get-pip.py" (funcionou sem problemas)

E executei o comando "pip install scikit-learn"

Após esse ultimo passo foi disparado essas msgs de erro

Building wheels for collected packages: scikit-learn Running setup.py bdistwheel for scikit-learn ... error Complete output from command d:\python\python.exe -u -c "import setuptools, tokenize;file='C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\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\LUCAS3~1\AppData\Local\Temp\tmp2b_ug6d2pip-wheel- --python-tag cp36: Partial import of sklearn during the build process. Traceback (most recent call last): File "C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\scikit-learn\setup.py", line 169, in get_numpy_status import numpy ModuleNotFoundError: No module named 'numpy' Traceback (most recent call last): File "C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\scikit-learn\setup.py", line 149, in get_scipy_status import scipy ModuleNotFoundError: No module named 'scipy' Traceback (most recent call last): File "", line 1, in File "C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\scikit-learn\setup.py", line 270, in setup_package() File "C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\scikit-learn\setup.py", line 250, in setup_package .format(numpy_req_str, instructions)) ImportError: Numerical Python (NumPy) is not installed. scikit-learn requires NumPy >= 1.6.1. 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 d:\python\python.exe -u -c "import setuptools, tokenize;file='C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\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\LUCAS3~1\AppData\Local\Temp\pip-6xo80eqa-record\install-record.txt --single-version-externally-managed --compile: Partial import of sklearn during the build process. Traceback (most recent call last): File "C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\scikit-learn\setup.py", line 169, in get_numpy_status import numpy ModuleNotFoundError: No module named 'numpy' Traceback (most recent call last): File "C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\scikit-learn\setup.py", line 149, in get_scipy_status import scipy ModuleNotFoundError: No module named 'scipy' Traceback (most recent call last): File "", line 1, in File "C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\scikit-learn\setup.py", line 270, in setup_package() File "C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\scikit-learn\setup.py", line 250, in setup_package .format(numpy_req_str, instructions)) ImportError: Numerical Python (NumPy) is not installed. scikit-learn requires NumPy >= 1.6.1. Installation instructions are available on the scikit-learn website: http://scikit-learn.org/stable/install.html


Command "d:\python\python.exe -u -c "import setuptools, tokenize;file='C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\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\LUCAS3~1\AppData\Local\Temp\pip-6xo80eqa-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\LUCAS3~1\AppData\Local\Temp\pip-build-qjr60rsp\scikit-learn\

solução!

No Windows eu não sei exatamente o problema que pode acontecer, mas no Linux (Ubuntu) acontece aquele detalhe de executar sem ser com sudo... Bom, da pra você tentar uma alternativa por meio do Conda.

Você pode instalar ele no Windows, e então, assim que instalar você executa o seguinte comando:

conda install scikit-learn

Eu já usei uma vez e deu certo, porém fiz no Ubuntu.

Espero ter ajudado.

Abraços

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software