Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name 'moduleTNC' - python

I'm having a problem in python when I try to import linear_model from sklearn library: from sklearn import linear_model. I have just installed it via pip simply in this way: pip install sklearn. I know that to avoid this error suffices uninstall and reinstall sklearn, but it didn't work. I also installed it via conda but opening the idle (is that correct?) it gives the same error. How to avoid it? NB: If I use jupyter from conda it works well as it should.

like image 964
Mader n fader Avatar asked Aug 09 '26 18:08

Mader n fader


2 Answers

I had this same problem and resolved it with:

conda remove scipy scikit-learn -y
conda install scipy scikit-learn -y

I saw it here, where many other people said it solved their problems too.

like image 117
Ryan Avatar answered Aug 11 '26 08:08

Ryan


With regards to the following error:

ImportError: cannot import name 'moduleTNC'

It can be solved by renaming moduletnc.cp36-win_amd64.pyd with moduleTNC.cp36-win_amd64.pyd in:

AppData\Roaming\Python\Python36\site-packages\scipy\optimize
like image 39
brahim Elmouden Avatar answered Aug 11 '26 07:08

brahim Elmouden



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!