I have looked various posts about python not getting the installed library. I tried using python -m pip install PyPDF2 to get this library installed but no luck. 
-
other modules have worked just fine?JeffCharter– JeffCharter2018-10-10 01:31:52 +00:00Commented Oct 10, 2018 at 1:31
-
Anything preinstalled with ArcGIS works fine.Demon– Demon2018-10-10 01:33:17 +00:00Commented Oct 10, 2018 at 1:33
-
Possible duplicate of How do I install pyPDF2 module using windows?Lukas– Lukas2018-10-10 01:35:02 +00:00Commented Oct 10, 2018 at 1:35
-
It could be a python path problem - try closing your C:\Python27 term and open it up again.JeffCharter– JeffCharter2018-10-10 01:36:28 +00:00Commented Oct 10, 2018 at 1:36
-
also what does this show: import site; site.getsitepackages()JeffCharter– JeffCharter2018-10-10 01:38:00 +00:00Commented Oct 10, 2018 at 1:38
|
Show 12 more comments
1 Answer
It looks like your PyPDF2 module is install inside the arcgis sub-directory If you add this to the top of your script that should do it
import sys
sys.path.append('c:\python27\argis10.5\lib\site-packages')
import PyPDF2
If you need you can also look into modifying your PYTHONPATH
Edit adding on to Jeff's answer:
I added a new pythonpath variable in environmental variables that I was missing to direct the python console to C:\Python27\ArcGIS10.5\Lib\site-packages

