tshrinivasan / OCR4wikisource

OCR for WikiSource using Google Drive OCR
GNU General Public License v2.0
33 stars 24 forks source link

IOError: [Errno 2] No such file or directory: '/etc/lsb-release' #47

Open commonssibi opened 8 years ago

commonssibi commented 8 years ago

Operating System : Debian Have completed the set up , authentication . Finished the changes in the config.ini . When I try to run the do_ocr.py I get the following error .

INFO:main:Running do_ocr.py 1.45 Traceback (most recent call last): File "do_ocr.py", line 68, in os_info = open("/etc/lsb-release") IOError: [Errno 2] No such file or directory: '/etc/lsb-release'

pythonioerror

commonssibi commented 8 years ago

I think that Debian doesnt have the /etc/lsb-release file . Upon reading the code , I found that , that piece of code which gets the os_info is vestigial . So I commented it and ran it :) It worked . @tshrinivasan .Please have a look and its upto you to decide whether the code is required or not .Or may be we can somewhere on the top try to get the Operating system info in other ways

tshrinivasan commented 8 years ago

Welcome to first Debian user :-)

I used lsb-release to find Ubuntu version.

Will check for Debian soon.

tshrinivasan commented 8 years ago

Is there any common command to find Ubuntu , Debian, centos, fedora distro and version?

commonssibi commented 8 years ago

I think we can try this /etc/*-release | uniq -u and get the NAME and VERSION ID . Can you please test it in Ubuntu . SO that we can get a generic code .

tshrinivasan commented 8 years ago

share the result of

cat /etc/*-release

from debian

commonssibi commented 8 years ago

PRETTY_NAME="Debian GNU/Linux 8 (jessie)" NAME="Debian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=debian HOME_URL="http://www.debian.org/" SUPPORT_URL="http://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"

tshrinivasan commented 8 years ago

can you run

sudo apt-get install lsb-release

and share the result of

cat /etc/*-release