HPLIP Syntax error invalid syntax
Follow @ggarronHPLIP: Installing HP Printer plugin
If you are installing a HP Printer on Arch Linux, and it is one that needs proprietary plugin, you may have problems while building that plugin.
This is because Arch Linux upgraded python from 2 to 3, so while you are running hp-setup or hp-plugin, if you see this error:
Verifying archive integrity... All good. Uncompressing HPLIP 3.10.9 Plugin Self Extracting Archive... File "./plugin_install.py", line 78 except ImportError, e: ^ SyntaxError: invalid syntax error: Python gobject/dbus may be not installed
You need to use python 2 to run the script instead of python 3, one easy way to do it is:
* The steps*
- Delete the
/usr/bin/pythonfile which is just a link to/usr/bin/python3 - Change to
/usr/binfolder - Create a new link, this time pointing to python 2.7
The commands
rm -rf /usr/bin/python
cd /usr/bin
ln -s /usr/bin/python2.7 python
You’re done.
But I preferred to make just an exception for this time, and create a temporal link, and leave the original one as it is.
The steps
- Go to
/tmpfolder - Create the link to python2.7
- Add /tmp to the path
- Export the new PATH variable
The commands
cd /tmp
link -s /usr/bin/python2.7 python
PATH=/tmp:$PATH
export PATH
Now, you can run all the programs you need to use python2 and then just delete the link in the /tmp folder and you are done.