问题
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