3
respostas

Erro no from sklearn.naive_bayes import MultinomialNB

Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: C:\Users\Administrador.DESKTOP-KC7H978\Desktop\Machine Learning\classificacao\classifica_acessos.py 
Traceback (most recent call last):
  File "C:\Users\Administrador.DESKTOP-KC7H978\Desktop\Machine Learning\classificacao\classifica_acessos.py", line 4, in <module>
    from sklearn.naive_bayes import MultinomialNB
  File "C:\Users\Administrador.DESKTOP-KC7H978\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sklearn\__init__.py", line 64, in <module>
    from .base import clone
  File "C:\Users\Administrador.DESKTOP-KC7H978\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sklearn\base.py", line 11, in <module>
    from scipy import sparse
  File "C:\Users\Administrador.DESKTOP-KC7H978\AppData\Local\Programs\Python\Python37-32\lib\site-packages\scipy\sparse\__init__.py", line 231, in <module>
    from .csr import *
  File "C:\Users\Administrador.DESKTOP-KC7H978\AppData\Local\Programs\Python\Python37-32\lib\site-packages\scipy\sparse\csr.py", line 15, in <module>
    from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
ImportError: DLL load failed: Não foi possível encontrar o módulo especificado.
>>> 
3 respostas

Reinstalado o problema persiste.

c:>python get-pip.py Collecting pip Using cached https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl Installing collected packages: pip Found existing installation: pip 19.0.3 Uninstalling pip-19.0.3: Successfully uninstalled pip-19.0.3 Successfully installed pip-19.0.3

c:>pip install -U scikit-learn Requirement already up-to-date: scikit-learn in c:\users\administrador.desktop-kc7h978\appdata\local\programs\python\python37-32\lib\site-packages (0.20.2) Requirement already satisfied, skipping upgrade: scipy>=0.13.3 in c:\users\administrador.desktop-kc7h978\appdata\local\programs\python\python37-32\lib\site-packages (from scikit-learn) (1.2.1) Requirement already satisfied, skipping upgrade: numpy>=1.8.2 in c:\users\administrador.desktop-kc7h978\appdata\local\programs\python\python37-32\lib\site-packages (from scikit-learn) (1.16.2)

c:>

Cara, tenta isso:

https://stackoverflow.com/questions/32675024/getting-pycharm-to-import-sklearn

pra mim deu certo.

Erro persiste.