写出高质量的博客 2021-09-04 22:33 采纳率: 100%
浏览 215
已结题

Import "sklearn.neighbors" could not be resolved?

csdn上好多说版本的问题?跟依赖的numpy不兼容?尝试了几个版本都不行,python3.7的环境。

img

img

  • 写回答

1条回答 默认 最新

  • 写出高质量的博客 2021-09-04 23:15
    关注

    python3.7环境
    第一步:pip unstall numpy scipy matplotlib scikit-learn
    第二步:(因为我安装的tensorflow2.5.0只支持numpy==1.19.2这个版本;pip插入scikit-learn依赖numpy和scipy,matplotlib并非依赖项,只是顺便降低一下版本)
    pip install numpy==1.19.2
    pip install scipy==1.3.1
    pip install matplotlib==3.1.1
    pip install scikit-learn==0.21.3

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 9月12日
  • 已采纳回答 9月4日
  • 创建了问题 9月4日