• Register
1 vote
3.6k views

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

Please log in or register to answer this question.

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.

OR

 

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 13 views
13 views
Problem: Any ideas on what I need to do to fix this? Thanks: Attributeerror: module 'importlib._bootstrap' has no attribute 'sourcefileloader'.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 818 views
818 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, 2020 mphil 2.3k points
0 votes
1 answer 1.1K views
1.1K 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
1 vote
1 answer 53 views
53 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, 2020 Gavin 15.3k points
0 votes
1 answer 7 views
7 views
Problem: I am stuck with this ... Please help me that how to deal with this error? attributeerror: module 'sys' has no attribute 'setdefaultencoding'
asked Mar 25 Ifra 24.4k points
0 votes
2 answers 11 views
11 views
Problem: how to I Solve this: error: attributeerror: 'module' object has no attribute 'create_default_context' HELP! I need help understanding this: attributeerror: 'module' object has no attribute 'create_default_context' Can someone please help solve this, I am new in python(). Someone have idea to solve this thanks!
asked Mar 11 Mashhoodch 13k points
0 votes
1 answer 52 views
52 views
Problem: attributeerror: module 'serial' has no attribute 'serial'
asked Feb 22 Dan phillip 4.7k points
0 votes
1 answer 142 views
142 views
I have tried to follow the documentation but was not able to use urlparse.parse.quote_plus() in Python 3: from urllib.parse import urlparse params = urlparse.parse.quote_plus({'username': 'administrator', 'password': 'xyz'}) I get AttributeError: 'function' object has no attribute 'parse'
asked Oct 25, 2020 psandprop 2.4k points
0 votes
1 answer 336 views
336 views
This line: sift = cv2.xfeatures2d.SIFT_create() return error: Traceback (most recent call last): File "C:/Python27/openCVskrypty/GUI/SOLUTION2.py", line 11, in <module> sift = cv2.xfeatures2d.SIFT_create() AttributeError: 'module' object has no attribute 'xfeatures2d' I ... ) and I haven't got xfeatures2d module. Does anyone know why? Can I download it separately? Thanks for help how fix this.
asked Oct 24, 2020 psandprop 2.4k points
0 votes
1 answer 66 views