Hello Guys, How are you all? Hope You all Are Fine. Today I am just trying to install python package But I am facing following error Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory in python. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
- How Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory Error Occurs ?
- How To Solve Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory Error ?
- Solution 1: Remove the MAX_PATH Limitation
- Solution 2: Remove folder and try again
- Solution 3: Set the registry
- Summary
How Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory Error Occurs ?
I am just trying to install python package But I am facing following error.
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'c:\\users\\ssc\\appdata\\roaming\\python\\python37\\site-packages\\pip-19.0.1.dist-info\\METADATA'
How To Solve Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory Error ?
How To Solve Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory Error ?
To Solve Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory Error In the latest versions of Windows, this limitation can be expanded to approximately 32,000 characters. Your administrator will need to activate the “Enable Win32 long paths” group policy, or set the registry value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled to 1.
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory
To Solve Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory Error In the latest versions of Windows, this limitation can be expanded to approximately 32,000 characters. Your administrator will need to activate the “Enable Win32 long paths” group policy, or set the registry value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled to 1.
Solution 1: Remove the MAX_PATH Limitation
Windows historically has limited path lengths to 260 characters. This meant that paths longer than this would not resolve and errors would result.
In the latest versions of Windows, this limitation can be expanded to approximately 32,000 characters. Your administrator will need to activate the “Enable Win32 long paths” group policy, or set the registry value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled
to 1
.
This allows the open()
function, the os
module and most other path functionality to accept and return paths longer than 260 characters.
After changing the above option, no further configuration is required.
Solution 2: Remove folder and try again
In my case I am facing error in this path. c:\\users\\ssc\\anaconda3\\envs\\env-gpu\\lib\\site-packages\\requests-2.24.0.dist-info\\METADATA
So I just delete ‘c:\\users\\ssc\\anaconda3\\envs\\env-gpu\\lib\\site-packages\\requests-2.24.0.dist-info’ path and Again try pip install my-package command And package installed successfully.
Solution 3: Set the registry
This is similar to solution 1. Just Click Start, and then click Run. In the Open box, paste %systemroot%\syswow64\regedit , and then click OK. Then Just set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled to 1
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read