Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 05-20-2012, 04:52 PM   #1
frisket
Member
frisket began at the beginning.
 
Posts: 14
Karma: 10
Join Date: May 2011
Device: Kindle
Installing on RHEL5_i386 Python error

I am trying to install Calibre on a Red Hat 5 server, and I'm getting this error when I paste the supplied sudo python command:
Code:
  File "<string>", line 1
    import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main()
                                                                                ^
SyntaxError: invalid syntax
As it's not clear where it's pointing (the Python people need to clean up their error reporting), I chopped up and pasted the commands into a file and tried to execute it. That got me
Code:
$ sudo python /usr/local/src/calibre.installer.py 
  File "/usr/local/src/calibre.installer.py", line 3
    u = __import__('urllib.request' if py3 else 'urllib', fromlist=1);
                                     ^
SyntaxError: invalid syntax
If it's really the conditional import that it's complaining about (the "if"), is there a version of the command string that will work under python-2.4.3-46 (presumably the command fails because the test for py3 isn't backwards compatible with anything before py3 :-)
frisket is offline   Reply With Quote
Old 05-20-2012, 05:33 PM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by frisket View Post
If it's really the conditional import that it's complaining about (the "if"), is there a version of the command string that will work under python-2.4.3-46 (presumably the command fails because the test for py3 isn't backwards compatible with anything before py3 :-)
I think Calibre requires Python 2.7 and is not compatible with Python 3.
itimpi is offline   Reply With Quote
Old 05-20-2012, 05:44 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The test for python 3 isn't backward compatible with anything before python 2.5, which is half a decade old. Simply download the calibre binary tarball and extract it manually, it will work, provided glibc on your system is >= 2.10
kovidgoyal is online now   Reply With Quote
Old 05-25-2012, 06:17 PM   #4
frisket
Member
frisket began at the beginning.
 
Posts: 14
Karma: 10
Join Date: May 2011
Device: Kindle
OK, thanks for the explanation. The installed Python is 2.4.3 so I'll do it on a more modern server and this one can wait until it gets replaced with something more usable.
frisket is offline   Reply With Quote
Reply

Tags
command, failed, python, rhel5, version


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python Function Error LoveMissBubbly Calibre 5 09-21-2011 04:52 PM
Python not installing on Ubuntu Robotech_Master Calibre 1 01-05-2011 07:08 AM
Help Kovid 7.31 still getting python error sadievan Calibre 10 11-28-2010 06:27 PM
Python error! didiyy Calibre 6 09-24-2010 02:05 AM
Installing Python? luqmaninbmore PocketBook 2 11-20-2009 01:41 AM


All times are GMT -4. The time now is 03:34 AM.


MobileRead.com is a privately owned, operated and funded community.