Milo Oster
Milo Oster

Reputation: 29

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\\Administrator\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\jedi\\third_party\\django-stubs\\django-stubs\\contrib\\contenttypes\\management\\commands\\remove_stale_contenttypes.pyi'

I tried to install jupyter

Upvotes: 2

Views: 1680

Answers (3)

delia
delia

Reputation: 1

For me it was the 260 character limit for file paths (about which python installer warned me at the end but I didn't pay enough attention to it :). I followed https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/ to change it and then installed jupyter without an issue afterwards

Upvotes: 0

Uriel-SG
Uriel-SG

Reputation: 11

Try with:

pip install scikit-learn

It will work.

Upvotes: 1

SLDem
SLDem

Reputation: 2182

Try using pip3 install sklearn, or pip install -U pip

Upvotes: 1

Related Questions