Код: Выделить всё
from sklearn.datasets._twenty_newsgroups import fetch_20newsgroups
Код: Выделить всё
ModuleNotFoundError: No module named 'sklearn'
Код: Выделить всё
pip3 install -U scikit-learn script matplotlib
Код: Выделить всё
from sklearn.datasets._twenty_newsgroups import fetch_20newsgroups
Код: Выделить всё
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
Я снова получил это сообщение об ошибке:
Код: Выделить всё
ImportError: Error importing numpy: you should not try to import numpy
from its source directory; please exit the numpy source tree,
and relaunch your python interpreter from there.
Код: Выделить всё
import sklearn
print(sklearn.__version__)
Код: Выделить всё
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
Я использую чип MacOS M1 и версию Python 3.13, а также установил версию scikit-learn 1.5.2 через терминал (команда пипа).
Подробнее здесь: https://stackoverflow.com/questions/791 ... -for-macos