Python sklearn installation windows

回眸只為那壹抹淺笑 提交于 2021-02-07 17:28:34

问题


When trying to install Python's sklearn package on Windows 10 using pip I am given an EnvironmentError that tells me there is no such file or directory of a specific file:

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'

I have tried reinstalling the following packages numerous times:

  • scikit-learn
  • scipy
  • sklearn

I have also tried downloading the github master folder for sklearn and pasting it into the directory where the installer expects the file to be, and even then when installing with pip it tells me the file is missing.

Furthermore I tried installing it via the github repository by downloading it and running

python setup.py install

But this results in weird Microsoft Visual Studio errors because apparently it is trying to run a test program or something, not sure.

Any suggestions to fix this problem?


回答1:


You can find the solution here: https://scikit-learn.org/stable/install.html

The problem occurs because the default path size limit is reached in your case, you can change this with the following steps:

  • open regedit tool (using windows cmd)
  • access the 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem' key
  • change the 'LongPathsEnabled' value to 1
  • reinstall sklearn using the command 'pip install --exists-action=i scikit-learn'


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!