LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   hp-toolbox launch error - python 3.8 issue? (https://www.linuxquestions.org/questions/slackware-14/hp-toolbox-launch-error-python-3-8-issue-4175667033/)

Chuck56 01-03-2020 03:13 PM

hp-toolbox launch error - python 3.8 issue?
 
The HP Device Manager is not launching from my panel widget nor from the cli. The error at the end is: ModuleNotFoundError: No module named 'distro'

I poked around in the /usr/lib64/python3.8/site-packages/pip/_vendor directory and didn't see the usual *.pyc files like are in the /usr/lib64/python2.7/site-packages/pip/_vendor directory.

I'm wondering if python 3.8 is the cause or do I need to look elsewhere?

Code:

me@desktop:~$ hp-toolbox
/usr/share/hplip/base/utils.py:2061: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if weburl is "" or weburl is None:

HP Linux Imaging and Printing System (ver. 3.19.12)
HP Device Manager ver. 15.0

Copyright (c) 2001-18 HP 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.

/usr/share/hplip/installer/core_install.py:2074: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if home_dir is "":
/usr/share/hplip/ui4/devmgr5_base.py:287: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.latest_available_version is not "":
/usr/share/hplip/ui4/devmgr5_base.py:409: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.latest_available_version is not "":
warning: Reportlab not installed. Fax coverpages disabled.
warning: Please install version 2.0+ of Reportlab for coverpage support.
Traceback (most recent call last):
  File "/usr/share/hplip/base/password.py", line 85, in get_distro_name
    os_name = platform.dist()[0]
AttributeError: module 'platform' has no attribute 'dist'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/hp-toolbox", line 280, in <module>
    toolbox = ui.DevMgr5(__version__, device_uri,  None)
  File "/usr/share/hplip/ui4/devmgr5.py", line 189, in __init__
    core =  CoreInstall(MODE_CHECK)
  File "/usr/share/hplip/installer/core_install.py", line 240, in __init__
    self.passwordObj = password.Password(ui_mode)
  File "/usr/share/hplip/base/password.py", line 118, in __init__
    self.__readAuthType()  # self.__authType
  File "/usr/share/hplip/base/password.py", line 140, in __readAuthType
    distro_name = get_distro_name().lower()
  File "/usr/share/hplip/base/password.py", line 87, in get_distro_name
    import distro
ModuleNotFoundError: No module named 'distro'
me@desktop:~$

EDIT: I'm running slackware64-current (with ktown)

ponce 01-03-2020 04:16 PM

I suppose your system is a slackware64-current: here I got the distro module as part of the python-pip package, both the 2.7 and 3.8 versions
Code:

$ grep distro /var/log/packages/* | grep python
/var/log/packages/python-pip-19.3.1-x86_64-2:usr/lib64/python2.7/site-packages/pip/_vendor/distro.py
/var/log/packages/python-pip-19.3.1-x86_64-2:usr/lib64/python2.7/site-packages/pip/_vendor/distro.pyc
/var/log/packages/python-pip-19.3.1-x86_64-2:usr/lib64/python3.8/site-packages/pip/_vendor/__pycache__/distro.cpython-38.pyc
/var/log/packages/python-pip-19.3.1-x86_64-2:usr/lib64/python3.8/site-packages/pip/_vendor/distro.py


Chuck56 01-03-2020 04:35 PM

I have the python-pip package installed with all its files. I see from you post that your system doesn't have a 3.8 distro.pyc either. Then I wonder what is going on with hplip on my system?

ponce 01-03-2020 05:04 PM

well, looking better at it, it seems an additional python-distro package is needed: try this (you have to build yourself one using a SlackBuild), the explanation should be in the slack-desc

http://ponce.cc/slackware/testing/python-distro/

Chuck56 01-03-2020 11:17 PM

Wow! That worked like a charm! Thanks for the SlackBuild ponce. The HP Device Manager is back in action on my system. I'll mark this thread as solved.

rworkman 01-03-2020 11:19 PM

That fixes it here; I guess python-distro will need to be added to Slackware -current...

cwizardone 01-04-2020 04:54 AM

Quote:

Originally Posted by ponce (Post 6074221)
well, looking better at it, it seems an additional python-distro package is needed: try this (you have to build yourself one using a SlackBuild), the explanation should be in the slack-desc

http://ponce.cc/slackware/testing/python-distro/

That works!
Many Thanks, Ponce!
:hattip:

USUARIONUEVO 01-04-2020 05:19 PM

python-distro was added today for current slackware.


All times are GMT -5. The time now is 01:10 PM.