hplip-install gives a syntax error

Bug #891080 reported by wrekced
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
In Progress
Undecided
goutam kodu

Bug Description

When I try to install, it gives me an error:

----------------------
| INSTALLING PLUG-IN |
----------------------

Verifying archive integrity... All good.
Uncompressing HPLIP 3.11.10 Plugin Self Extracting Archive.........................................
  File "./plugin_install.py", line 78
    except ImportError, e:
                      ^
SyntaxError: invalid syntax
error: Python gobject/dbus may be not installed

Done.

I tried downloading the manual install tarball. Here is the result:

[wrekced@wrekced0 hplip-3.11.10]$ ./hplip-install
  File "./install.py", line 91
    sys.exit(0)
                ^
TabError: inconsistent use of tabs and spaces in indentation

As you can see, there is some problem with reading install.py. I think that the problem is in the code before this point. However, I don't know Python. On the other hand, taking the extra spaces @ lines 89, 90 and the extra tabs @ lines 91, 92 out of install.py moves the error to line 100:

[wrekced@wrekced0 hplip-3.11.10]$ ./hplip-install
  File "./install.py", line 100
    except getopt.GetoptError, e:
                             ^
SyntaxError: invalid syntax
[wrekced@wrekced0 hplip-3.11.10]$

The output of hp-check is attached

Thanks,
wrekced

Revision history for this message
wrekced (wrekced) wrote :
Revision history for this message
goutam kodu (goutam-hplip) wrote :

Hi,

Which linux distribution you are using ?

Thanks,
Goutam Kodu

Revision history for this message
wrekced (wrekced) wrote :

OS: Arch Linux x86_64 with multilib (32 bit libs) enabled
Desktop Enviornment: KDE
Printer: HP LaserJet 1018

Revision history for this message
goutam kodu (goutam-hplip) wrote :

Hi,

To install hplip you require to install lot of dependencies. The below link will help you to install the dependencies and installing hplip.

http://hplipopensource.com/hplip-web/install/manual/distros/other.html

Let me know if you need more.

Thanks,
Goutam Kodu

Changed in hplip:
status: New → In Progress
assignee: nobody → goutamkk (goutam-hplip)
Revision history for this message
wrekced (wrekced) wrote :

I have gone over the list on the page you suggested. I think I have everything. I still get a syntax error when i try to load the plugin:

$ sudo hp-plugin -i reason 1
Password:

HP Linux Imaging and Printing System (ver. 3.11.10)
Plugin Download and Install Utility ver. 2.1

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

(Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)

/
------------------------------------------
| PLUG-IN INSTALLATION FOR HPLIP 3.11.10 |
------------------------------------------

  Option Description
  ---------- --------------------------------------------------
  d Download plug-in from HP (recomended)
  p Specify a path to the plug-in (advanced)
  q Quit hp-plugin (skip installation)

Enter option (d=download*, p=specify path, q=quit) ? d

--------------------------
| DOWNLOAD CONFIGURATION |
--------------------------

Checking for network connection...
Downloading configuration file from: http://hplip.sf.net/plugin.conf
Downloading configuration: [\ ] 0%

-------------------
| DOWNLOAD PLUGIN |
-------------------

Checking for network connection...
Downloading plug-in from: http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-3.11.10-plugin.run
Downloading plug-in: [***********************************************************************************] 100% 8.0 KB Receiving digital keys: /usr/bin/gpg --no-permission-warning --keyserver pgp.mit.edu --recv-keys 0xA59047B9

----------------------
| INSTALLING PLUG-IN |
----------------------

Verifying archive integrity... All good.
Uncompressing HPLIP 3.11.10 Plugin Self Extracting Archive.........................................
  File "./plugin_install.py", line 78
    except ImportError, e:
                      ^
SyntaxError: invalid syntax
error: Python gobject/dbus may be not installed

Done.

I tried re-installing Python. Still the get the same problem.

Revision history for this message
wrekced (wrekced) wrote :

hp-check says my Python version is 2.7.2. I also have the latest Python installed. Do you think that my newer python 3.2 installation has changed something that is causing this error?

Revision history for this message
wrekced (wrekced) wrote :

I found out what is causing this error:
I looked up the "except" keyword for Python. There is a" : " missing after "except" on line 100 of "install.py".

This is a programming error. Not caused by missing dependencies.

This file is part of "hplip-3.11.10-plugin.run".

How do I open it up to add the missing colon to the file? (What program should I use?)

Revision history for this message
wrekced (wrekced) wrote :

Sorry! I was wrong about thaat last bit. I'm still looking for the error.

Revision history for this message
wrekced (wrekced) wrote :

I just figured it out:

This is because of my Python 3 installation! see: http://docs.python.org/release/3.0.1/whatsnew/3.0.html
Sorry to have bothered you!

I have two questions:
1. Where should I put the bug report for this? I think it now goes to the maintainers of my distro.

2. If I bring this script up to spec with Python 3, do you want a copy? (I'm learning Python as I go)

Thank you
wrekced

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi Wrekced,

Currently Python 3 is not yet supported by HPLIP. Please use Python 2 and /usr/lib/python needs to be linked to python-2.x instead of python-3.x

Thanks & Regards,
Amarnath

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.