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

Viewed 120075

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.

8 Answers

Run CMD in administrator mode and enter:

pip install sklearn --user

and Done!!

Try sudo pip install 'package name' --user

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.

Fixed by doing

conda install google-pasta

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

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

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

Related