LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-27-2017, 06:15 PM   #1
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
-current hplip mixes Python 3 and 2 in a way that doesn't work


Am I the only one getting this?
Code:
dugan@slackbookpro ~> /usr/bin/hp-upgrade 
Traceback (most recent call last):
  File "/usr/bin/hp-upgrade", line 34, in <module>
    from base import utils, tui, module, os_utils, services, validation
  File "/usr/share/hplip/base/module.py", line 30, in <module>
    from . import tui, utils, device
  File "/usr/share/hplip/base/device.py", line 42, in <module>
    from . import status
  File "/usr/share/hplip/base/status.py", line 33, in <module>
    import cupsext
ImportError: No module named cupsext
It looks to me like -current's hplip package mixes Python 2 and 3 code in a way that doesn't work.

The entry point is a Python 2 file.

Code:
dugan@slackbookpro ~> ls -l /usr/bin/hp-upgrade 
lrwxrwxrwx 1 root root 25 Nov 27 15:44 /usr/bin/hp-upgrade -> ../share/hplip/upgrade.py*
Its shebang is:

Code:
#!/usr/bin/python
Which means it's executed with the Python 2 interpreter.

This series of imports eventually leads to the package's status.py being imported. This is a Python 3 file, and its shebang is:

Code:
#/usr/bin/python3
That file tries to import cupsext, which the hplip package only ships for Python 3:

Code:
dugan@slackbookpro ~> grep cupsext /var/log/packages/*
/var/log/packages/hplip-3.17.11-x86_64-1:usr/lib64/python3.6/site-packages/cupsext.la
/var/log/packages/hplip-3.17.11-x86_64-1:usr/lib64/python3.6/site-packages/cupsext.so
However, it can't find these files because it's running in the Python 2 interpreter, and crashes.

Is there something wrong with my installation, or is this a bug with either hplip or Slackware?

Last edited by dugan; 11-27-2017 at 07:03 PM.
 
Old 11-27-2017, 09:41 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
I'm not getting line 34 in module like you are:-

Code:
bash-4.3$ ls -l /usr/bin/hp-upgrade 
lrwxrwxrwx 1 root root 25 Jul  5  2016 /usr/bin/hp-upgrade -> ../share/hplip/upgrade.py
Python 2.7 here where you have 3.6--

Code:
bash-4.3$ grep cupsext /var/log/packages/*
/var/log/packages/hplip-3.16.5-x86_64-3:usr/lib64/python2.7/site-packages/cupsext.la
/var/log/packages/hplip-3.16.5-x86_64-3:usr/lib64/python2.7/site-packages/cupsext.so
Could be a bug in hplip. FWIW the only bug I've ever had with Slackware in 6 years was a xscreensaver bug.

https://answers.launchpad.net/hplip/+question/658190

This output is with stable 'not' current and I haven't upgraded phython:-

If you'd like I could run a handful of cmds to help you compare. Just let me know.
 
Old 11-27-2017, 10:15 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Original Poster
Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
This output is with stable 'not' current and I haven't upgraded python
Yeah I'm pretty sure this only affects current.

Just tried it on my other installation, which is also -current. Same "No module named cupsext" crash.
 
Old 11-27-2017, 10:43 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Original Poster
Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
I'm now sure of the following:

a) it's an hplip bug, where the shebang-rewriting that's supposed to happen during "make install" isn't working properly for Python 3 builds

b) Pat can work around this by building hplip for Python 2 instead of Python 3.
 
1 members found this post helpful.
Old 11-27-2017, 11:07 PM   #5
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by dugan View Post
I'm now sure of the following:

a) it's an hplip bug, where the shebang-rewriting that's supposed to happen during "make install" isn't working properly for Python 3 builds

b) Pat can work around this by building hplip for Python 2 instead of Python 3.
Shame it's a bug:- Failure during make install is a sure sign.

I'm sure Pat will work it out.

IS it possible dugan to to build hplip for Python 3? There are only subtle differences between Python 2 and Python 3, right?

I think you can chat with him on Twitter:-
https://twitter.com/volkerdi?lang=en
 
Old 11-27-2017, 11:11 PM   #6
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Reading here to find out more:-

http://sebastianraschka.com/Articles..._key_diff.html

https://www.activestate.com/blog/201...different-time
 
Old 11-28-2017, 01:11 AM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Quote:
Originally Posted by Ztcoracat View Post
I think you can chat with him on Twitter
A big No. Pat reads LQ and Twitter is not a bug tracker at all. I hope you were kidding...
 
Old 11-28-2017, 01:27 AM   #8
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by Didier Spaier View Post
A big No. Pat reads LQ and Twitter is not a bug tracker at all. I hope you were kidding...
Yup.....just kidding:-

Are you running current?

IF so, how long does it take to boot?
 
Old 11-28-2017, 09:06 AM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Original Poster
Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Looks like Pat fixed it in today's update.
 
Old 11-28-2017, 05:12 PM   #10
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by dugan View Post
Looks like Pat fixed it in today's update.
Great news!-
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
printing with hplip doesn't work: /usr/lib/cups/backend/hp failed ToK Linux - Hardware 10 02-02-2011 04:45 PM
HPlip woes on --current ; Sharing printer gets broken if the hplip gui is launched Old_Fogie Slackware 2 10-28-2010 10:23 AM
Python plasmoids don't work (-current, KDE 4.2.2+) raffaele181188 Slackware 2 06-16-2009 06:09 AM
Python doesn't work zirtik Programming 9 10-17-2005 05:28 AM
python doesn´t work little_ball Linux - Newbie 4 12-04-2004 09:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration