I have installed pyPDF2 module using pip install pyPDF2 command in it is successfully installed. But when I import pyPDF2 module i get error no module named pyPDF2
Asked
Active
Viewed 114 times
0
-
What operating system do you use? What python version do you use? If you use python3: Try to install the module with pip3 instead of pip. – snaeil Feb 24 '21 at 12:47
-
i also tried that but having same error and I am using python3 in window 10 – Feb 24 '21 at 12:50
-
You can create an environment with pip and within that environment try it again. An alternative to pip is conda btw. I suspect your python to be the wrong one. You might have "multiple pythons" on your system and probably you are using the one that is not able to get the pip modules. – snaeil Feb 24 '21 at 13:02
-
I'm using python pip module and created a game in python. It is only having error in pyPDF2 module. But I if you say i will uninstall python and reinstall it – Feb 24 '21 at 13:08
-
Check first if the answer from ghchoi helps you. – snaeil Feb 24 '21 at 13:16
1 Answers
1
Probably because your pip
is not for your python
. Check if
which pip
which python
show the same parent directory.
If they don't you should use another pip
inside bin
of which python
. Or, the following
python -m pip install
may use the proper pip
for your python
.

ghchoi
- 4,812
- 4
- 30
- 53
-
@RanjanaDadhich `which pip` and `which python` show the same path to `bin`? – ghchoi Feb 24 '21 at 14:06
-
not working showing "'which' is not recognized as an internal or external command, operable program or batch file." it can be my mistake but i started python just week ago – Feb 24 '21 at 14:18
-