Hi,
I am trying to install PyPDF2 package, as my system does not has direct internet access, so I downloaded package and trying to install.
While installing, it is not giving error and package is also not install.
Following is shown on command Prompt : -
C:\PDFMerge>pip install PyPDF2-1.26.0.tar.gz
Processing c:\rajesh_sw\pdfmerge\pypdf2-1.26.0.tar.gz
C:\PDFMerge>
After this also, on executing Program, following error is thrown : -
C:\PDFMerge>python PDFMerge.py
Traceback (most recent call last):
File "PDFMerge.py", line 1, in
from PyPDF2 import PdfFileMerger
ModuleNotFoundError: No module named 'PyPDF2'
C:\PDFMerge>
Hi! Could you please try to install newer pip and see if the problem persists?
Edit: it's strange that your install log only have Processing but no Installing; you can get some insight by toggling verbose output, e.g. pip install PyPDF2-1.26.0.tar.gz --verbose
.
@McSinyx Many users aren't familiar with get-pip -- in general, https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py is a better place to link to. :)
Hi @RajeshSeervi! Your comment seems to be poorly formatted. I request you to read https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/ and improve the formatting of your comment by editing it in place, using the pencil icon in the corner.
In addition to @McSinyx's suggestions of trying a newer pip version (pip 9.0.3 was released in 2018; there have been >20 pip releases since then) and the --verbose
flag, could you also provide the output of python -m pip --version
and pip --version
? It might be that PATH variable contains a directory with the python
executable, that's from a different directory/installation than the one from which pip
is found.
Hi,
thanks for quick reply.
I tried upgrading pip, but it is telling up-to-date.
Following are required outputs for version, verbose : -
C:\PDFMerge>pip --version
pip 9.0.3 from c:\users\rajesh1.choudhary\appdatalocal\programspythonpython36-32\lib\site-packages (python 3.6)
C:\PDFMerge>python -m pip --version
pip 9.0.3 from C:\Users\rajesh1.choudhary\AppData\Local\Programs\Python\Python36-32\lib\site-packages (python 3.6)
C:\PDFMerge>
C:\PDFMerge>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\rajesh1.choudhary\appdatalocal\programspythonpython36-32\lib\site-packages
C:\PDFMerge>
C:\PDFMerge>pip install PyPDF2-1.26.0.tar.gz --verbose
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Processing c:\pdfmerge\pypdf2-1.26.0.tar.gz
C:\PDFMerge>
Regards,
Rajesh
Can you try to install some other packages apart from PyPDF2
and see if you can import them?
That will narrow down if the issue is with pip, or the way you are installing PyPDF2
.
Also there seems to be some output missing from the pip install PyPDF2-1.26.0.tar.gz --verbose
command. Generally there is a Successfully installed ..
message at the end if the package is successfully installed.
That and the Config variable...
message tells me that the tar might be wrong too. Did you take it from https://github.com/mstamy2/PyPDF2/releases ?
You can also try a higher version of python, or try python -m pip install PyPDF2
Hi Devesh,
I tried installing another package Numpy and it worked. I have copied it below.
Regarding output of pip install PyPDF2-1.26.0.tar.gz --verbose command, I am also surprised that why other logs are not coming and why it is not installed.
But seems like package is correct, because I installed same package (PyPDF2-1.26.0.tar.gz) on Linux and it worked there. Only difference is that on Linux, I have used anaconda Python.
I took this tar from https://pypi.org/project/PyPDF2/
Following is output of installing another Package and PyPDF2 on Windows : -
C:\Rajesh_SW\PDFMerge>pip install numpy
Collecting numpy
Downloading https://files.pythonhosted.org/packages/2c/9e/bbc88697f01adcbff866c6c2cefb5f5a895863513bca074b51f740960d3f/numpy-1.18.4-cp36-cp36m-win32.whl (10.8MB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 10.8MB 66kB/s
Installing collected packages: numpy
Successfully installed numpy-1.18.4
C:\Rajesh_SW\PDFMerge>
C:\Rajesh_SW\PDFMerge>
C:\Rajesh_SW\PDFMerge>
C:\Rajesh_SW\PDFMerge>pip install pyPDF2
Collecting pyPDF2
Using cached https://files.pythonhosted.org/packages/b4/01/68fcc0d43daf4c6bdbc6b33cc3f77bda531c86b174cac56ef0ffdb96faa
b/PyPDF2-1.26.0.tar.gz
C:\Rajesh_SW\PDFMerge>
C:\Rajesh_SW\PDFMerge>
Thanks & Regards,
Rajesh
So since other packages are installable, this doesn't seem to be a pip problem.
I would suggest filing an issue with PyPDF2, perhaps on their github repo with your observations, or on their email mentioned under Contact the PyPDF2 maintainers
at http://mstamy2.github.io/PyPDF2/ . You can also install a newer version from pip via https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py , if you are unable to upgrade your older pip.
With that in mind, I think you can go ahead and close the issue.
Ok, I will try to contact PyPDF2 maintainers.
Thanks