简体   繁体   中英

ImportError: cannot import name '_argmax' from 'sklearn.utils.fixes'

I am setting up a Machine Learning model using Linear Regression however trying to run

from sklearn.model_selection import train_test_split 

throws below exception:

ImportError: cannot import name '_argmax' from 'sklearn.utils.fixes'

I am working with PyCharm (Jupyter notebook) and also tried restarting kernel.

However, when I try to run code from Pycharm in a Python file it works.

I reinstalled sklearn followed by creating conda virtual environment. I then used this newly created conda venv from Pycharm and the code start working ie PyCharm no longer raised import error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM