Reputation: 441
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'**.
Upvotes: 34
Views: 363055
Reputation: 435
My solution related to pip version error,
Hope to help you!
Upvotes: 0
Reputation: 1
I had the same problem to solve it was pretty easy at first run PowerShell in the administrator mode then type in this command New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ` -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force then restart your PC and run your pip install command and everything should work Note: I got this info from "https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later" for more info visit the website.
Upvotes: 0
Reputation: 173
So i deleted my venv, restarted my machine, then i created a new venv, finally everything works fine.
Upvotes: 0
Reputation: 478
This same error can also happen when using a requirements.txt
if the file isn't formatted correctly, with an output that might resemble:
$ pip install -r requirements.txt
Processing /private/tmp/pygments-20230806-6216-4zajry/Pygments-2.16.1 (from -r requirements.txt (line 2))
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/private/tmp/pygments-20230806-6216-4zajry/Pygments-2.16.1'
Recreating this file with pip freeze > requirements.txt
fixed this for me!
Upvotes: 0
Reputation: 1
You can resolve this issue by enabling Windows Long Paths support by following these steps:
Open the Group Policy Editor by running gpedit.msc in the command prompt. Go to Computer Configuration > Administrative Templates > System > Filesystem. Find the Enable Win32 long paths policy and enable it.
Upvotes: 0
Reputation: 9
This is how I fixed similar issue when I installed tensorflow:
Further study: "https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/#:~:text=In%20Windows%2010%20Pro%20or%20Enterprise%2C%20hit%20Start%2C,%E2%80%9CEnable%20win32%20long%20paths%E2%80%9D%20item%20and%20double-click%20it."
Upvotes: 1
Reputation: 4609
For me issue was with the long paths support for Windows. And here they suggest the solution and worked fine for me.
Windows Fix Maximum Path Length Limitation
From the above source this is the final solution
The registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled (Type: REG_DWORD) must exist and be set to 1
Upvotes: 2
Reputation: 1
The steps here fixed it https://www.youtube.com/watch?v=rKYRcwbFp6Y . The step is basically to change the include-system-site-packages to true in pyvenv.cfg file in your virtual env folder
Upvotes: -3
Reputation: 400
Fixed by doing
conda install google-pasta
this directory under envs/xxxx/Lib/site-packages/ was not having METADATA. Likely to be partial installation.
Upvotes: 2
Reputation: 421
Run CMD in administrator mode and enter:
pip install sklearn --user
and Done!!
Upvotes: 36
Reputation: 1
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
Upvotes: 0
Reputation: 403
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.
Upvotes: 4
Reputation: 301
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':
https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/
Upvotes: 30