Python Forum
Problem with installing PyPDF2
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with installing PyPDF2
#1
Hello,
Here is what happens when I'm trying to install PyPDF2:
Output:
sudo pip3 install PyPDF2 Traceback (most recent call last): File "/usr/bin/pip3", line 9, in <module> from pip import main ImportError: cannot import name 'main'
Any suggestions ?
Thanks.
Reply
#2
(Nov-10-2019, 01:52 PM)Pavel_47 Wrote: File "/usr/bin/pip3", line 9, in <module>
Bug report
Quote:User runs the system wrapper from /usr/bin/pip3 which is from the OS-supplied pip 8.
This wrapper expects to see pip 8, but it doesn't because user site takes priority over system site.
So it can use the old pip-8 that's placed in /usr/bin/pip3,newest version is now pip-19.3.1.
A fix that is in the link.
sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall

Or pyenv Simple Python Version Management then is never sudo or pip3 and it use internal pip version from Python.
Then it work like this.
# Check pip see that it point to Python version not OS
tom@tom:~$ pip -V
pip 19.3.1 from /home/tom/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip (python 3.7)

# Install
tom@tom:~$ pip install PyPDF2
Collecting PyPDF2
  Downloading .....
Installing collected packages: PyPDF2
  Running setup.py install for PyPDF2 ... done
Successfully installed PyPDF2-1.26.0
Reply
#3
Worked. Thanks !
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Photo Problem installing turtle MasterJediKnight7 17 24,315 Mar-18-2024, 10:22 AM
Last Post: bmohamadyar313
  PyPDF2 deprecation problem gowb0w 5 3,535 Sep-21-2023, 12:38 PM
Last Post: Pedroski55
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,393 Aug-07-2023, 05:32 AM
Last Post: DPaul
  [WORKED AROUND] Problem installing elitech-datareader, 'cannot import build_py_2to3' NeilUK 4 1,570 Jul-09-2023, 10:01 AM
Last Post: NeilUK
  Pypdf2 will not find text standenman 2 878 Feb-03-2023, 10:52 PM
Last Post: standenman
  pyPDF2 PDFMerger close pensding file japo85 2 2,341 Jul-28-2022, 09:49 AM
Last Post: japo85
  PyPDF2 processing problem Pavel_47 6 9,646 May-04-2021, 06:58 AM
Last Post: chaitanya
  Problem Installing rasterio gw1500se 1 2,167 Mar-24-2020, 06:28 PM
Last Post: gw1500se
  Problem installing library thunderspeed 2 2,280 Mar-22-2020, 11:04 PM
Last Post: thunderspeed
  Please help: problem installing/importing langdetect module in Jupyter Notebook ledgreve 3 7,191 Dec-30-2019, 08:17 AM
Last Post: LeanbridgeTech

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020