DEV Community

Discussion on: Convert any .pdf file 📚 into an audio 🔈 book with Python

 
redeving profile image
Kelvin Thompson • Edited

I just started getting the same thing on my system (Ubuntu). After a lot of Google/StackExchange, this worked (copy from my annotations):

For whatever reason, in order to install the following two, I had to install some stuff on my Ubuntu Mate ** system-wide ** to get rid of compile errors:

sudo apt-get install python3-setuptools python3-dev libpython3-dev
sudo apt-get update
sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python-dev

I'm using PyCharmCE. After the above, I could use this in the PyCharm terminal:

pip3 install pdftotext
pip3 install gtts

After I did all of that, successful! Program works like a charm (hehe).

Cheers!

Thread Thread
 
mustafaanaskh99 profile image
Mustafa Anas

Thanks for sharing your solution!

Thread Thread
 
redeving profile image
Kelvin Thompson

A pleasure to finally be able to give back a little!

Thread Thread
 
ash_wanth profile image
Ashwanth

I have a Mac, brother. Can't use app-get. what should i do now?

Thread Thread
 
davidsouza profile image
David Souza

Are you using the default Python 2.7?? You may need to use Python 3.x

Thread Thread
 
davidsouza profile image
David Souza

I got this working on the Mac using Python 3.7.4 using virtual env and brew. Works fine.

Thread Thread
 
jogeshpi03 profile image
Jogesh

I am using docker with my Macbook without any issue. And it is a great alternative to start working on any environment, stack, etc.