View Single Post
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