fritz-hh / OCRmyPDF

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched
260 stars 31 forks source link

Script asks me to install Python 2.x although I have Python 2.7.5 installed #97

Closed juancarlosfarah closed 9 years ago

juancarlosfarah commented 10 years ago

I tried using the script, but when I tried to run it with the -h flag to see the usage, I was asked to install Python 2.x. As shown in the output below, I already have Python 2.7.5 installed.

System:

$ python --version
Python 2.7.5

Steps to reproduce:

  1. $ sh ./OCRmyPDF.sh -h

Expected:

Actual:

Please install python v2.x. Exiting...

fritz-hh commented 10 years ago

Thanks for your report. I will take it into account for the next version (i.e. improve robustness)

ocrmypdf currently checks if the command "python2" is available. This does not seem to be the case on your system. As the "python" command calls the python 2.7.5 interpreter, you can solve the issue on your system by creating a symbolic link from python2 to python.

ln -s /usr/local/bin/python /usr/local/bin/python2 (supposing that the path to your python binary is /usr/local/bin/python) (You can get the path to your python binary by calling "which python")

andreasotto commented 9 years ago

This is the case under linux (Debian 6) too. Setting a symlink helps.

martinburch commented 9 years ago

To get this working, the actual command I needed to use in OS X was: sudo ln -s /usr/bin/python /usr/bin/python2

jbarlow83 commented 9 years ago

Should be fixed in v3.0-rc2