using pip3: module "importlib._bootstrap" has no attribute "SourceFileLoader"
Solution 1
Tried to install Tensorflow in venv on Windows 10 machine with python 3.8 and got the same issue.
What helped for me was:
pip install setuptools --upgrade
Solution 2
I had the same problem on my ubuntu 18.04 with python 3.6. None of the above methods helped, but this one solved the problem:
pip3 uninstall setuptools
Solution 3
I had the same error whatever I asked to pip. I gave a look to this page: https://packaging.python.org/tutorials/installing-packages/
That line is the one that solved my problem:
python3 -m pip install --upgrade pip setuptools wheel
Solution 4
pip install setuptools --upgrade
This command fixed my problem
Solution 5
If you face this issue in anaconda environment, simply upgrade setuptools using the following:
conda install -c conda-forge setuptools
Arsenal591
Updated on July 05, 2022Comments
-
Arsenal591 almost 2 years
I have installed pip for python 3.6 on Ubuntu 14. After I run
sudo apt-get install python3-pip
to install pip3, it works very well. However, after installation, when I am trying to run
pip3 install packagename
to install a new package, something strange occurs:
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"
It seems that I did nothing wrong, and I really cannot figure out the reason.
-
DtechNet almost 4 yearsStill get same error - Ubuntu 14: AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
-
Okw over 3 yearsI had issues with fs-uae-launcher not starting on Debian Buster because: AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader' Uninstalling setuptools fixed it.
-
rkachach over 3 yearsThanks for the solution, none of the above solution worked and this issue was annoying my day :)
-
Stanislav Ivanov over 3 yearsAlso helps for Ubuntu 18.04
-
wrkyle over 3 yearsAfter upgrading from Ubuntu 19.10 to 20.04 I had this problem with pip3. Nothing I'd found worked. This finally solved it.
-
Mrinal Kamboj almost 3 yearsI have
Pop!_OS 20.10
based on Ubuntu and this helped -
bm13kk almost 3 years
pip3 uninstall setuptools
make it worsepip3 install setuptools
same error as in topick -
Paul P M over 2 yearshelped also on Pop!_OS 21.10 as well