Home > Software design >  Import module could not be resolved
Import module could not be resolved

Time:06-07

I've successfully installed "PyPDF2" module and checked it using the command 'pip list'. yet when I try to import it i receive this message: '''Import "PyPDF2" could not be resolved''' enter image description here

CodePudding user response:

The version of python that you installed the module in and the version that your IDE is using might be different check what version you installed it in by typing

pip -VV

in your terminal and check in what version your IDE is using (for vs code its usually shown at the bottom left or can be seen in the command pallete by typing Python: Select Interpreter)

another reason this could happen is if you are using an IDE like pycharm which by default creates a virtual environment for each project in which case you would need to either install your module from pycharm's terminal or activate the virtual environment and then install in it (docs here show how to https://docs.python.org/3/tutorial/venv.html)

CodePudding user response:

  1. Make sure you have installed PyPDF2
pip install PyPDF2
  1. Select the correct interpreter

Click

  • Related