Can not install modules - AttributeError: 'NoneType' object has no attribute 'loader'

Can not install modules - AttributeError: 'NoneType' object has no attribute 'loader'

当尝试从 windows CMD 使用 pip 或 python 时,它向我抛出此警告:

Error processing line 1 of c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\protobuf-3.7.0-py3.7-nspkg.pth:
Traceback (most recent call last):
    File "c:\users\james\appdata\local\programs\python\python37-32\lib\site.py", line 168, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "<frozen importlib._bootstrap>", line 580, in module_from_spec
  AttributeError: 'NoneType' object has no attribute 'loader'

Remainder of file ignored

其他 python 脚本通常 运行 没问题。然而,在尝试安装SpaCy时,这个错误是致命的,无法安装包

我已经尝试重新安装 pip 和 python,并尝试从 windows 设置中修复它们,到目前为止非常成功。即使只是尝试安装预编译的二进制文件也会失败!

即使只是在命令提示符中输入 pip returns 同样的警告!

如果有人知道如何防止此错误,或找到安装软件包的解决方法,我们将不胜感激

您可以尝试使用较低的字符安装包,否则包可能会出错尝试任何其他版本