类似的报错:
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> h5py
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
解决方法:
1,
pip install h5py==
我输入的话是:
pip install sklearn==
或者是:(楼主脑子不大好使,记性差)
pip install scikit_learn==
2,
然后我报错红字:
scikit_learn-1.0.2-cp37-cp37m-win_amd64.whl
这个文件找不到,于是采取了两个步骤,不知道第一步是否关键
(1)进入https://pypi.tuna.tsinghua.edu.cn/simple/scikit-learn,搜索我需要的版本,移入到安装的目录下,进入TF环境后再输入pip install scikit_learn-1.0.2-cp37-cp37m-win_amd64.whl
(参考文献:pip install scikit_learn-1.0.2-cp37-cp37m-win_amd64.whl)
(2)发现加载很慢,于是楼主直接使用了镜像下载
pip install scikit_learn-1.0.2-cp37-cp37m-win_amd64.whl -i https://pypi.douban.com/simple/
两秒完成
3,成功截图


成功解决:No module named 'sklearn'