windows下安装ipython时提示OSError: [Errno 2] No such file or directory、remove_stale_contenttypes.pyi

 配置环境时提示如下的错误,而且后面的步骤就无法进行了,找到下面这个很深的文件夹下发现这个pyi文件并不存在。由于只是临时使用,不想安装conda。

最后测试发现是windows机器上的最大文件路径长度限制的问题。

在注册表编辑器中,导航到以下键:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem,找到一个名为LongPathsEnabled的值,将 "值数据 "框中的数值从0改为1,然后点击确定。没有的话需要通过右键单击 FileSystem 键,选择新建 > DWORD(32 位)值,然后将新值命名为 LongPathsEnabled 来创建它。

即可解决问题。

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_gbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages\\jedi\\third_party\\django-stubs\\django-stubs\\contrib\\contenttypes\\management\\commands\\remove_stale_contenttypes.pyi' 

你可能感兴趣的:(python,ipython,django,python)