New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import name 'moduleTNC' #4830

Closed
chanansh opened this Issue Jun 8, 2015 · 9 comments

Comments

Projects
None yet
10 participants
@chanansh

chanansh commented Jun 8, 2015

from sklearn import roc_curve
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'roc_curve'
from sklearn.metrics import roc_curve
Traceback (most recent call last):
File "", line 1, in
File "C:\Anaconda3\lib\site-packages\sklearn\metrics__init__.py", line 7, in
from .ranking import auc
File "C:\Anaconda3\lib\site-packages\sklearn\metrics\ranking.py", line 30, in
from ..utils.stats import rankdata
File "C:\Anaconda3\lib\site-packages\sklearn\utils\stats.py", line 2, in
from scipy.stats import rankdata as sp_rankdata
File "C:\Anaconda3\lib\site-packages\scipy\stats__init
_.py", line 338, in
from .stats import *
File "C:\Anaconda3\lib\site-packages\scipy\stats\stats.py", line 189, in
from . import distributions
File "C:\Anaconda3\lib\site-packages\scipy\stats\distributions.py", line 10, in
from .distn_infrastructure import (entropy, rv_discrete, rv_continuous,
File "C:\Anaconda3\lib\site-packages\scipy\stats_distn_infrastructure.py", line 23, in
from scipy import optimize
File "C:\Anaconda3\lib\site-packages\scipy\optimize__init
_.py", line 176, in
from ._minimize import *
File "C:\Anaconda3\lib\site-packages\scipy\optimize_minimize.py", line 32, in
from .tnc import _minimize_tnc
File "C:\Anaconda3\lib\site-packages\scipy\optimize\tnc.py", line 37, in
from scipy.optimize import moduleTNC, approx_fprime
ImportError: cannot import name 'moduleTNC'

@lesteve

This comment has been minimized.

Member

lesteve commented Jun 8, 2015

As you can see from your traceback, the import error happens in scipy so something went wrong when you installed scipy. Since you are using Anaconda the simplest thing you can try is to reinstall scipy and scikit-learn along these lines:

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

This comment has been minimized.

Member

jnothman commented Jun 14, 2015

reopen if the issue persists

@jnothman jnothman closed this Jun 14, 2015

@Barbarrosa

This comment has been minimized.

Barbarrosa commented Aug 1, 2015

@lesteve Thanks! This solved an issue I was having.

@seindlut

This comment has been minimized.

seindlut commented Jan 12, 2016

Thank you for solving my problem @lesteve

@emerson19

This comment has been minimized.

emerson19 commented Apr 5, 2016

Solved it for me as well, thanks

@Michael728

This comment has been minimized.

Michael728 commented Apr 7, 2016

solved my problem ,thanks

@matiji66

This comment has been minimized.

matiji66 commented Jan 15, 2017

卸载了自己安装的python,用Anaconda 进行安装,就不存在这些问题了。
Thanks.

@hack-r

This comment has been minimized.

hack-r commented Jul 15, 2017

Trying to install gensim did this to me, even though it claimed to rollback its uninstall of scipy

@amueller

This comment has been minimized.

Member

amueller commented Jul 15, 2017

closing to avoid "me too". Feel free to open a new issue if this pops up again.

@scikit-learn scikit-learn locked and limited conversation to collaborators Jul 15, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.