本文编写于 1229 天前,最后修改于 1229 天前,其中某些信息可能已经过时。
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\Users\Rik\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sklearn\datasets\tests\data\openml\292\api-v1-json-data-list-data_name-australian-limit-2-data_version-1-status-deactivated.json.gz'

重新安装多次无效
一开始以为是用户路径指向有问题
查找隐藏文件没有任何问题
确实缺少一个包
猜测windows下载sklearn的这个包出error了

实际上确实是(
发生此问题是达到了默认路径大小限制,可以通过以下步骤进行更改

打开regedit工具(使用Windows cmd)
访问“ HKEY_LOCAL_MACHINE SYSTEM

  1. 打开regedit工具(使用Windows cmd)
  2. 访问 “HKEY_LOCAL_MACHINESYSTEM CurrentControlSetControlFileSystem”将“ LongPathsEnabled”值更改为1
  3. 使用'pip install --exists-action=i scikit-learn'重新安装sklearn

Referrence:https://stackoverflow.com/questions/60756394/python-sklearn-installation-windows