Skip to main content
 首页 » 编程设计

python之导入错误 : cannot import name 'moduleTNC'之python

2024年12月31日10hnrainll

当我尝试从 sklearn 库导入 linear_model 时,我在 python 中遇到问题:from sklearn import linear_model。我刚刚通过 pip 以这种方式简单地安装了它:pip install sklearn。我知道要避免此错误就足以卸载并重新安装 sklearn,但它没有用。我也通过 conda 安装了它,但打开空闲(正确吗?)它给出了同样的错误。 如何避免? 注意:如果我使用 conda 中的 jupyter,它会正常工作。

请您参考如下方法:

我遇到了同样的问题并通过以下方法解决了:

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

我看到了here ,许多其他人说它也解决了他们的问题。