0

I am trying to add my HP printer to my Ubuntu. When I click on the "printers icon" in the settings, nothing happen. I am new to Ubuntu and I have no idea how to fix this. I tried to use hplib and if I type hpsetup I got this:

No command    'hpsetup' found, did you mean:
Command 'hp-setup' from package 'hplip' (main)
hpsetup: command not found    so I typed hp-setup and I got this

So I tried hp-setup and I got

Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 563, in <module>
main()
File "/usr/lib/python2.7/site.py", line 545, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 237, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 578, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 524, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 408, in _init_posix
from _sysconfigdata import build_time_vars
File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd

Which I have no idea at all what does this means and what to do... Any help...

1

1 Answer 1

1

There's actually a pretty easy set of ways to install HP printers in Ubuntu. What I's suggest first for a new user, is a graphic method using Ubuntu's tools.

Open the Settings program (click the 'gear' in the top right corner, and settings is the third entry in the menu) and look for the printers icon - there is a little Add button in the top left corner of the window which pops up, allowing you to add a printer. It will scan for printers, so you should have your printer hooked up and powered on.


If you are more adventurous, and would like to install from the command line there are a couple of things you have to do:

Open a terminal window (press ctrl+alt+t)

Ubuntu 15.10 does not have the following program fully installed, so it needs to be removed and re-installed:

sudo apt-get remove hplip
sudo apt-get install --install-suggests hplip

Now the hpsetup program can be executed

hp-setup

This will open a set of terminal windows which guide you through the process of connecting the HP printer.

5
  • The problem is when I click on the "printers" icon, nothing happened! I tried the terminal one and if I type hpsetup I got this:
    – abd
    Nov 4, 2015 at 5:55
  • Please look at my edited post @charlesGreen
    – abd
    Nov 4, 2015 at 6:04
  • The errors mean that the python libraries were not fully installed in your computer. please execute the command sudo apt-get install build-essential linux-headers-generic, and try again Nov 4, 2015 at 14:56
  • Update for Ubuntu bionic, in 2022: sudo apt-get install --install-suggests hplip returns: ``` Need to get 6467 MB of archives. After this operation, 22.8 GB of additional disk space will be used. ``` I think I'll look for a Raspberry-Pi which can print to an HP printer for less than 22GB of HD space...
    – axello
    Oct 10, 2022 at 14:39
  • @axello Yes, the HPLip program set does include quite a bit of stuff, most of which will not be used by most people, such as the CUPS print system, and the SANE scanner interface. Additionally if not already installed, it used libc6, and python3, and a graphical interface. Oct 10, 2022 at 22:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .