ImportError cannot import name main in pip

0 votes

Hi Guys,

I am getting this below error, when I am trying to install numpy in my system.

$ pip3 install numpy
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'

How can I solve this error?

Apr 15, 2020 in Python by akhtar
• 38,170 points
1,543 views

1 answer to this question.

0 votes

Hi@akhtar,

To avoid this error, you should upgrade pip in your system.

$ sudo pip install pip --upgrade

If it will not work then uninstall pip and install again. 

answered Apr 15, 2020 by MD
• 95,060 points

Related Questions In Python

0 votes
1 answer

How to resolve ImportError: cannot import name 'add' in python ?

There's no module called "add" in random. ...READ MORE

answered Feb 12, 2019 in Python by Mark
2,605 views
0 votes
1 answer

Error:after upgrading pip: cannot import name 'main'

Hello @kartik, You must have inadvertently upgraded your ...READ MORE

answered Jun 5, 2020 in Python by Niroj
• 82,560 points
517 views
0 votes
1 answer

ImportError:cannot import name numpy_type_map

Hi@MengWel, You need to install the torch library first ...READ MORE

answered Jun 23, 2020 in Python by MD
• 95,060 points
564 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,851 views
0 votes
0 answers
0 votes
1 answer

ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' (unknown location)

Hi@akhtar, I think there is a problem in ...READ MORE

answered Apr 22, 2020 in Python by MD
• 95,060 points
2,499 views
+1 vote
1 answer

ImportError: cannot import name 'appdirs'

Hi@akhtar, I think you missed some module to ...READ MORE

answered May 5, 2020 in Python by MD
• 95,060 points
1,017 views