本文介绍了以下错误是什么意思:AttributeError:模块'importlib._bootstrap_external'没有属性'_w_long'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近在Windows中通过conda安装了github程序包,从而创建了一个新的Python环境.

Recently installed a github package through conda in windows that has created a new Python environment.

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

Whenever I try to run Spyder in the new environment I get the following error:

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 channel conda-forge conda create -n ox --strict-channel-priority osmnx

osmnx and the command as given on the github page: conda config --prepend channels conda-forge conda create -n ox --strict-channel-priority osmnx

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

Solved: Path variable in windows pointed to some different Python file locations.

推荐答案

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

This is because python and pip are installed on different sources. For more info, please look at the following post

使用pip3:模块"importlib._bootstrap"没有属性"SourceFileLoader"

这篇关于以下错误是什么意思:AttributeError:模块'importlib._bootstrap_external'没有属性'_w_long'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 10:19