ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory

While installing the scikit-learn in python or a few other python packages, you may encounter an error like this in Windows machines.

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\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'

To fix this error, modify the registry value, Long install path

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

Modify the value of LongPathsEnabled from 0 to 1

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.