Python Error: ModuleNotFoundError: No module named 'sklearn'

7 Ansichten (letzte 30 Tage)
Zair Ahmedi
Zair Ahmedi am 22 Mai 2019
Kommentiert: Eric Delgado am 22 Feb. 2021
Hi,
I was calling Python from MATLAB but I got the above error.
I have installed sklearn using PyCharm and it ran normally using Python.
What should I do to enable the package on MATLAB?
  2 Kommentare
Eric Delgado
Eric Delgado am 22 Feb. 2021
Bearbeitet: Eric Delgado am 22 Feb. 2021
Hey @Zair Ahmedi, I am having the same issue... I can import "math module", but not "numpy module", for example. Did you find a solution?! I don't want to reinstall Matlab or Python! :)
Eric Delgado
Eric Delgado am 22 Feb. 2021
@Zair Ahmedi, I figure out what happened with my issue... I had two instances of Python installed on my computer. So Matlab was pointing to the raw version of Python (without Numpy and others modules).
So I just configure the right version of Python and it's allright now. :)
pyenv('Version', 'C:\ProgramData\Anaconda3\python.exe')

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by