module 'importlib._bootstrap' has no attribute '_w_long'

别等时光非礼了梦想. 提交于 2021-02-08 15:16:23

问题


I am trying to install django-adim-tools using pip, but this is what happens:

C:\Users\hugo.villalobos>pip install django-admin-tools
Could not import runpy module
Traceback (most recent call last):
  File "C:\Python34\Lib\runpy.py", line 14, in <module>
    import importlib.machinery # importlib first so we can test #15386 via -m
  File "C:\Python34\Lib\importlib\__init__.py", line 34, in <module>
    _w_long = _bootstrap._w_long
AttributeError: module 'importlib._bootstrap' has no attribute '_w_long'

I have no idea how to proceed to solve it. Thanks for your help


回答1:


In my case, I have multiple Python (3.7, 3.6, 3.4) installed in my PC. The environment var $PATH and $PYTHONPATH is pointing to different version's. After resetting these 2 environment vars correctly everything runs correctly then.




回答2:


had similar issue running the command:

pipenv install --python 3.8

solved by removing python3.8 from environment variable $PATH, and keeping only 3.7 as default python:

C:\Users\MB\AppData\Local\Programs\Python\Python37\Scripts\
C:\Users\MB\AppData\Local\Programs\Python\Python37\


来源:https://stackoverflow.com/questions/46509441/module-importlib-bootstrap-has-no-attribute-w-long

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!