. Advertisement .
..3..
. Advertisement .
..4..
I am new to python and searching the “attributeerror: module ‘importlib._bootstrap’ has no attribute ‘sourcefileloader’” to understand it better. It seems it doesn’t work as expected when I used some suggestions before. Here is the command line I use:
sudo apt-get install python3-pip
pip3 install packagename
The error I’m getting is below:
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1479, in <module>
register_loader-type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module "importlib._bootstrap" has no attribute "SourceFileLoader"
Please give me the solution to this issue.
The cause:
You had to face up with this error because
python3.6
andpip3
were not downloaded from the same sources.Solution:
To solve this error, you need to install pip i.e. And I recommend you using the built-in python facility to install it as following:
This will set up
pip3
&pip3.x
, where x ispython3.x
.python2
also work with this way.This error occurs when you run
pip install dotenv
; the package ispython-dotenv
and notdotenv
.It worked for me.