• Register
Log In
0 votes

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.

7.5k points

1 Answer

0 votes

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


36.1k points

Related questions

0 votes
1 answer 216 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 29 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.2k points
1 vote
1 answer 279 views
Problem : I am very beginner to Tensorflow. I am trying to use the Tensorflow from past couple of days. Now I am trying to install it and again reinstalling it again and again in my python2.7 and 3.4. But after doing so many installations I am still facing below ... for your reference: tf_in = tf.placeholder("float", [None, A]) # Features I need urgent help to fix above strange looking error.
asked Apr 29 stewart 4k points
1 vote
1 answer 59 views
Problem: I installed tkinter and I wrote this code to check if this works or not: import tkinter as tink a = tink.Tink() a.title('Total Seconds') button = tink.Button(a, text='Welcome', width=40, command=a.destroy) button.pack() a.mainloop() But after running this ... ", line 2, in <module> a = tink.Tink() AttributeError: module 'tkinter' has no attribute 'Tink' Can anyone help me to solve this?
asked Apr 29 samhaz 5k points
0 votes
1 answer 508 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