【问题标题】:What does the following error mean: AttributeError: module 'importlib._bootstrap_external' has no attribute '_w_long'?以下错误是什么意思:AttributeError:模块'importlib._bootstrap_external'没有属性'_w_long'?
【发布时间】:2020-03-24 21:08:54
【问题描述】:

最近在windows中通过conda安装了一个github包,创建了一个新的Python环境。

每当我尝试在新环境中运行 Spyder 时,都会出现以下错误:

Error processing line 1 of C:\Users\cip18jjp\Anaconda3\envs\ox\lib\site-packages\matplotlib-3.2.1-py3.8-nspkg.pth:

  Traceback (most recent call last):
    File "C:\Users\cip18jjp\Anaconda3\\Lib\site.py", line 168, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "C:\Users\cip18jjp\Anaconda3\Lib\importlib\__init__.py", line 51, in <module>
      _w_long = _bootstrap_external._w_long
  AttributeError: module 'importlib._bootstrap_external' has no attribute '_w_long'

Remainder of file ignored
Python 3.8.2 | packaged by conda-forge | (default, Mar 23 2020, 17:32:17) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

osmnx 和github页面上给出的命令:conda config --prepend channels conda-forge conda create -n ox --strict-channel-priority osmnx

已解决:windows 中的路径变量指向一些不同的 Python 文件位置。

【问题讨论】:

    标签: python anaconda spyder attributeerror


    【解决方案1】:

    这是因为 python 和 pip 安装在不同的源上。更多信息,请查看以下帖子

    using pip3: module "importlib._bootstrap" has no attribute "SourceFileLoader"

    【讨论】:

      猜你喜欢
      • 2018-03-12
      • 2021-01-08
      • 2019-07-02
      • 1970-01-01
      • 2020-11-24
      • 1970-01-01
      • 1970-01-01
      • 2019-12-23
      • 1970-01-01
      相关资源
      最近更新 更多