As a newbie... I am having difficulties installing pyPDF2 module. I have downloaded. Where and how do I install (setup.py) so I can use module in python interpreter?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
To install setup.py files under Windows you can choose this way with the command line:
cd C:\Users\User\Downloads\pyPDF2
to go into the directory where thesetup.py
is (this is mine if I downloaded it) The path can be copied from the explorer window.dir
now you should see the name setup.py in the listing of all contentsC:\python27\python.exe setup.py install
I use Python2.7 here. UseC:\python33\python.exe setup.py install
for python 3.3 and so on. You can follow these instructions now if you wish: http://docs.python.org/2/install/index.htmlAnother way, that does not show when there are problems, is:
setup.py
C:\Users\User\Downloads\pyPDF2\setup.py
(this is where my setup.py is)you modify that path in the following way:
The
"
are important if you have white spaces in the path nameIn all cases you may need to restart your python to be able to import the module.
When you do this feel free to post your solution also with pictures for other newbies looking for it.
If you have pip, PyPDF2 is on the Python Package Index, so you can install it with the following in your terminal/command prompt:
pip install PyPDF2
Here's how I did it: After you have downloaded and installed Python (it usually installs under C:\Python** (** being python version - usually 27)), copy the extracted PyPDF2 contents to C:\Python** folder, after that enter in command prompt/terminal "cd C:\Python27\python.exe setup.py install". If you did everything right it should start installing PyPDF2.
If you have
pip
, use it to install PyPDF2 from the command line:For python2:
For python3:
Note that if you have multiple versions of python3 installed, you will need to be very explicit. Ex, for Python 3.7:
Read more here.
In case you need to upgrade your
pip
installer:To upgrade pip (for Python 2) in Windows (or Linux, I think):
To upgrade pip3 (for Python 3):
1) in Windows:
OR if you need to be explicit since you have multiple 3.x versions installed:
2) In Linux I think it is: