Python: Could Not Install Packages Due to an Oserror: [Errno 2] No Such File or Directory

I try to use pip to install sklearn, and I receive the following error message:

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\Users\13434\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\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'**.

Can anyone help? Thanks.

1

7 Answers

I had exactly the same issue installing this package on my Windows laptop - then read of the 260 character limit. I followed this guide - and after rebooting, successfully installed 'sklearn':

3

Run CMD in administrator mode and enter:

pip install sklearn --user

and Done!!

0

Try sudo pip install 'package name' --user

3

I removed and reinstalled Python and then entered this into my terminal command line:

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pip install --upgrade pip

and it fixed my issue.

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pip install

and it should work.

0

If Windows is 8.
You need to change your access policy inside Python3 repository where all packages, including PIP.

"Properties" -> "Security" -> select a user -> select "Change" and everything below.
Next, update PIP (py -m pip install --upgrade pip) and install the packages inside ENV

Fixed by doing

conda install google-pasta

this directory under envs/xxxx/Lib/site-packages/ was not having METADATA. Likely to be partial installation.

keep package up to date.I upgarde my pip and the problem is gone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest