ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory:报错处理

windows环境下安装python依赖报错如下:

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

HINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at ht tps://pip.pypa.io/warnings/enable-long-paths

解决办法:

错误1:,这是因为你的user文件夹权限不够,需要打开c盘右击user或者用户文件夹,点击授予访问权限会出现以下界面,点击User,然后点击编辑,赋予User所有的权限。
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory:报错处理_第1张图片
错误2:从 Windows 10 版本 1607 开始,MAX_PATH限制已从常见的 Win32 文件和目录函数中删除,因此需要启用长路径。

win+r打开运行界面,键入REGEDIT,找到以下位置:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem。

找到LongPathsEnabled的条目,双击打开,在“值”数据字段中,输入值1。这将启用“长路径”选项。

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory:报错处理_第2张图片

pip再次安装成功。

你可能感兴趣的:(Python,python,pip,pip,ERROR)