# Printer prints gibberish whenever it is used

## bsquared938

Hey,

So I have been trying to install an HP LaserJet P2035 printer on my computer over the past few days.  

I emerged CUPS and configured it - the printer is accepting jobs, all right...

The problem is that the printer, whenever it prints anything, just prints out one line (the same one line) over about 10 pages.  The line takes up only the first line of everyone of the pages it prints on.  Also, regardless of the document/file/picture being sent to the printer, it always prints this exact same line, on the same number of pages, every time.

I thought that the printer itself might be acting up, but whenever I attach the printer to some other (non-linux) computer, the printer prints fine...

I figured that this might be a driver issue, and upon consulting the HP support website for linux, I found that this printer model (above) needs the hplip package.  I tried to emerge that package and I get this error:

```

emerge -av hplip

>>> Emerging (1 of 1) net-print/hplip-3.12.10a

 * hplip-3.12.10a.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                       [ ok ]

 * hplip-3.12.10-patches-1.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ...                              [ ok ]

 * ERROR: net-print/hplip-3.12.10a failed (setup phase):

 *   PYTHON(): Active version of CPython 2 not set

 * 

 * Call stack:

 *               ebuild.sh, line   93:  Called pkg_setup

 *   hplip-3.12.10a.ebuild, line   78:  Called python_set_active_version '2'

 *           python.eclass, line 1750:  Called PYTHON '-2'

 *           python.eclass, line 1908:  Called die

 * The specific snippet of code:

 *               die "${FUNCNAME}(): Active version of CPython 2 not set"

 * 

 * If you need support, post the output of `emerge --info '=net-print/hplip-3.12.10a'`,

 * the complete build log and the output of `emerge -pqv '=net-print/hplip-3.12.10a'`.

 * The complete build log is located at '/var/tmp/portage/net-print/hplip-3.12.10a/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-print/hplip-3.12.10a/temp/die.env'.

 * Working directory: '/usr/lib64/portage/pym'

 * S: '/var/tmp/portage/net-print/hplip-3.12.10a/work/hplip-3.12.10a'

>>> Failed to emerge net-print/hplip-3.12.10a, Log file:

>>>  '/var/tmp/portage/net-print/hplip-3.12.10a/temp/build.log'

 * Messages for package net-print/hplip-3.12.10a:

 * ERROR: net-print/hplip-3.12.10a failed (setup phase):

 *   PYTHON(): Active version of CPython 2 not set

 * 

 * Call stack:

 *               ebuild.sh, line   93:  Called pkg_setup

 *   hplip-3.12.10a.ebuild, line   78:  Called python_set_active_version '2'

 *           python.eclass, line 1750:  Called PYTHON '-2'

 *           python.eclass, line 1908:  Called die

 * The specific snippet of code:

 *               die "${FUNCNAME}(): Active version of CPython 2 not set"

 * 

 * If you need support, post the output of `emerge --info '=net-print/hplip-3.12.10a'`,

 * the complete build log and the output of `emerge -pqv '=net-print/hplip-3.12.10a'`.

 * The complete build log is located at '/var/tmp/portage/net-print/hplip-3.12.10a/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-print/hplip-3.12.10a/temp/die.env'.

 * Working directory: '/usr/lib64/portage/pym'

 * S: '/var/tmp/portage/net-print/hplip-3.12.10a/work/hplip-3.12.10a'

```

So I'm not to sure what to do at this point.  I am not sure if it is a driver issue, or if it is a CUPS issue....

Any ideas?

----------

## The Doctor

Welcome to the forums.

You will need hplip for the driver. It also includes a tool to configure and monitor your printer. You can try emerging it with the minimal flag to only get the drivers, but it looks like your problem is with python.

What does eselect python list show? If you only have python 3 installed, try emerge -av1 dev-lang/python:2.7

By the way, I experienced exactly the same issue with my HP printer. The problem is the driver.

----------

## bsquared938

Hi,

Thanks for the warm welcome  :Smile: .

Had a feeling that the driver was the issue...

Upon running eselect python list I get:

```

eselect python list

Available Python interpreters:

  [1]   python2.7

  [2]   python3.2 *

```

And upon running emerge -av dev-lang/python:2.7:

```

emerge -av dev-lang/python:2.7

 

* IMPORTANT: 2 news items need reading for repository 'gentoo'.

 * Use eselect news to read news items.

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] dev-lang/python-2.7.3-r3:2.7  USE="gdbm hardened ipv6 ncurses readline ssl threads (wide-unicode) xml -berkdb -build -doc -examples -sqlite -tk -wininst" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No]

```

I didn't emerge the python 2.7 package...should I follow through with this?

I had run the  emerge -av python command a few times after I got this hplip emerge error....

----------

## The Doctor

Try setting your active version to python 2 via eselect. It is probably looking at the active version of python and having a fit because it isn't python 2. Reinstalling python shouldn't have any affect so I don't think it will help.

----------

## bsquared938

Thank you so much for your advice!   :Smile: 

Okay so I changed the python version using eselect python set 1...

But now I can't run the emerge -av hplip command at all...kept it there for 5 minutes and it doesn't do anything.  Upon changing the python version back to 3.*, it seems to work okay again...

The console just doesn't do anything unless I hit Ctrl+C to cancel the command...

I was seeing somewhere that there might be something going on where hplip looks at Python 3, and there is a way to point it to the Python 2.....could this be a possibility?

Thanks...

----------

## Jaglover

Running python-updater is in order.

----------

## bsquared938

Hmm...

Ran the python-updater command and it got stuck on the 2nd package out of 5 when it was emerging (using the  python-updater command).

I have set the python version to 2.7 (see above posts...), not sure why it froze while emerging...

----------

## jburns

Set python 3 as the active python version, then run python-updater, and then emerge hplip.

----------

## bsquared938

Okay so this is the order that I entered commands in order to get hplips up and running again (I believe....it took a while to figure this out...).  I would also like to give credit to someone here in my office who helped me out  with this issue as well:

1) First I set python version to 2.7 using eselect python list

2) Re-emerge python versions 2.7 and 3.2, independently

3) Ran python-updater to make sure it worked out (it didn't freeze after the above steps were carried out...)

4) Emerge hplips

Then I was able to install the printer driver and print meaningful stuff  :Smile: .

Thanks to everyone who helped on the forums!!  :Very Happy: 

----------

