• Register
1 vote

Problem :

I have installed the pip for python 3.6 on my Ubuntu 14. By using below command :

sudo apt-get install python3-pip

Now to install pip3, it works very well. But after doing the installation, when I want to run it by using below command :

pip3 install packagename

When I try to install the new package, something strange occurs as 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"

It appears that I did nothing wrong but I am really unable to figure out the reason behind the above error.

6 5 3
7,540 points

1 Answer

1 vote

Solution :

I had faced the similar problem in the recent past. I think this is happening simply because the  python3.6 and pip3 were installed from the different sources. So I suggest you to use the python's inbuilt facility to install the pip as follows :

python3 -m ensurepip --upgrade

This should help you in installing your pip3 and pip3.x where x in python3.x. Same works for the python2 also.



I had the same problem in the recent past on my ubuntu 18.04 with the python 3.6. None of the above methods really helped, but below one solved my problem:

pip3 uninstall setuptools


9 7 4
38,600 points
The first method worked on my linux, thank you.
glad u found it useful kumpas, it worked for me as well

Related questions

0 votes
1 answer 466 views
Problem : I am new to HTMLParser my terminal showing me below error :- from django.utils.html import format_html, format_html_join, escape File "/usr/local/lib/python3.5/dist-packages/django/utils/html.py", line 16, in from .html_parser import HTMLParser, HTMLParseError ... I replace the HTMLParser with some other similar? Or should I try to downgrade the python ? Can someone help on this issue?
asked Mar 2 mphil 2.3k points
1 vote
1 answer 34 views
Problem: I want to install one package named speech_tools-2.1-release.tar.gz. After I run the command ./configure in this package, it shows me a message:\ Configure: error: no acceptable C compiler found in $PATH See 'config.log' for more details Any solution would be much appreciated. Thanks.
asked Mar 10 Gavin 15.3k points
0 votes
1 answer 687 views
Problem : I run sudo pip install git-review, and get the following error cannot fetch index base url https://pypi.python.org/simple/
asked Oct 22, 2019 peterlaw 6.9k points
0 votes
1 answer 185 views
Problem: I have only fundamental knowledge related to python, pandas and dataframe.I have tried to write the below code: df = pd.DataFrame(np.random.rand(12,2), columns=['Apples', 'Oranges'] ) df['Categories'] = pd.Series(list('AAAABBBBCCCC')) pd.options.display. ... I will be more than glad to get more ideas on the above error regarding why it is occurring and also how to fix this error?
asked Aug 24 Raphael Pacheco 4.9k points