There are several ways to install PyPDF2. The most common option is to use pip.
PyPDF2 requires Python 2.7+ to run, but Python 2 is dead. Please use a recent version of Python 3 instead.
Typically Python comes with
pip, a package installer. Using it you can
pip install PyPDF2
If you are not a super-user (a system adminstrator / root), you can also just install PyPDF2 for your current user:
pip install --user PyPDF2
Anaconda users can install PyPDF2 via conda-forge.
In case you want to use the current version under development:
pip install git+https://github.com/py-pdf/PyPDF2.git