I am using python 3.9.6. But when I typed like this in command prompt,
"pip install pypdf2"
it worked for me. Try like this sometimes it'll work.
I am on Windows 10, running python 3.8.5 and have tried installing PyPDF2 using pip. I've uninstalled and reinstalled several times using these two commands:
"python -m pip install pypdf2"
"py -3 -m pip install pypdf2"
I did this through Visual Studio code being run as my user, as well as the command prompt run as an administrator. The install goes well but I get the error, "Import 'PyPDF2' could not be resolved."
I figure this is due to the file path to the installed package not being included in the PATH system environment variable. So I used "python -m pip show pypdf2" to find the install location:
"c:\users*username*\appdata\local\programs\python\python38\lib\site-packages"
So I added:
"c:\users*username*\appdata\local\programs\python\python38\lib\site-packages\PyPDF2" to my PATH environment variable for both user and system, as well as the PYTHONPATH variable.
After such actions I restarted VS Code, which again is using the python 3.8.5 environment, and still the import could not be resolved.
What am I missing? Any assistance would be greatly appreciated.
Trouble importing python packages Visual Studio Code