You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



Python dist-packages problem? -- null distro/platform name

Author (Read 3202 times)

0 Members and 4 Guests are viewing this topic.

Python dist-packages problem? -- null distro/platform name
« Reply #1 on: February 18, 2021, 01:01:24 AM »
 

HiTechHiTouch

  • New to Forums
  • *
  • 4
    Posts
  • Reputation: 0
  • Linux Lite Member
    • View Profile

  • CPU: Amd-E1-2500 integrated Radeon HD

  • MEMORY: 4Gb
In attempting to install my HP P1606dn printer, I learned that an additional piece of code beyond the HPLIP 3.20.11 provided materials is required.  To install this support module, HP provides HPLIP-3.20.11-plugin.run, a python script.  This script uses platform.dist()[0] to obtain the name of the distribution.  The error message is "AttributeError: module 'platform' has no attribute 'dist'".

The function is in /usr/lib/python3/dist-packages (1.4.0), and "pip install distro" reports "Requirement already satisfied: distro in /usr/lib/python3/dist-packages (1.4.0)"

Code: [Select]
+ hp-plugin

HP Linux Imaging and Printing System (ver 3.20.11)
Plugin Download and Install Utility ver 2.1

qt5ct: using qt5ct plugin
Checking for network connection...
Downloading plugin from:
Traceback (most recent call last):
  File "/usr/share/hplip/base/password.py", line 85, in get_distro_name
    os_name = platfrom.dist()[0]
AttributeError: module 'platfrom' has no attribute 'dist'

The HP helper hp-plugin fails to install for many (non LL) distributions because the packager did not pick up the Python distro package, which is now required for Python 3.8+ because of code removal in 3.8.

So... I went down the chain to see that LL indeed had a usable dist-packages.  All appears well, i.e. the LL distribution is NOT missing the newly required dist-packages. 

However, dist-packages claims to be HIGHLY system dependent, poking around in C libraries and other places to figure out what to report.  See https://pypi.org/project/distro for background.  Also https:docs.python.org/2/library/platform.html section 15.15.5

So may I politely ask if the LL packager needs to do something to have dist-packages report the distribution name?  (I assume it would be Ubuntu, 20.04.x, Focal Fossa).
« Last Edit: October 12, 2021, 01:30:38 PM by firenice03 »
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section