SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

Bug #2073948 reported by Vineeth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

Hi Team ,
I am having a bulk order production of printing using imx8 board , the number are 1000-3000 units a year . so kindly help us in printing usb for hp1108.
I am trying to print using imx8 board using usb with hpp1108 printer:- Following are the details of yocto

   1. Your Linux Distribution and version.
     repo init -u git://git.toradex.com/toradex-manifest.git -b kirkstone-6.x.y -m tdxref/default.xml

       HP Linux Imaging and Printing System (ver. 3.19.12)
        Printer/Fax Setup Utility ver. 9.0

    2. Your printer make/model
    • HP_LaserJet_Professional_P1108 SN NO : CNF3412644

    3.hp-check -r
/usr/bin/hp-check:685: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 'getfacl' not in g and '' is not g and 'file' not in g:
Saving output in log file: /etc/cups/hp-check.log

HP Linux Imaging and Printing System (ver. 3.19.12)
Dependency/Version Check Utility ver. 15.1

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.

Note: hp-check can be run in three modes:
1. Compile-time check mode (-c or --compile): Use this mode before compiling the HPLIP supplied tarball (.tar.gz
or .run) to determine if the proper dependencies are installed to successfully compile HPLIP.
2. Run-time check mode (-r or --run): Use this mode to determine if a distro supplied package (.deb, .rpm, etc)
or an already built HPLIP supplied tarball has the proper dependencies installed to successfully run.
3. Both compile- and run-time check mode (-b or --both) (Default): This mode will check both of the above cases
(both compile- and run-time dependencies).

Check types:
a. EXTERNALDEP - External Dependencies
b. GENERALDEP - General Dependencies (required both at compile and run time)
c. COMPILEDEP - Compile time Dependencies
d. [All are run-time checks]
PYEXT SCANCONF QUEUES PERMISSION

Status Types:
    OK
    MISSING - Missing Dependency or Permission or Plug-in
    INCOMPAT - Incompatible dependency-version or Plugin-version

warning: tdx wayland with xwayland distro is not found in AUTH_TYPES
warning: 0-6.7.0-devel-20240722120714-build.0 version is not supported. Using 0-0 versions dependencies to verify and install...

---------------
| SYSTEM INFO |
---------------

 Kernel: 5.15.148-6.7.0-devel+git.bfdbfb2c85fb #1 SMP PREEMPT Thu Jun 20 15:59:41 UTC 2024 GNU/Linux
 Host: apalis-imx8-14904058
 Proc: 5.15.148-6.7.0-devel+git.bfdbfb2c85fb #1 SMP PREEMPT Thu Jun 20 15:59:41 UTC 2024 GNU/Linux
 Distribution: 0 6.7.0-devel-20240722120714-build.0
 Bitness: 64 bit

-----------------------
| HPLIP CONFIGURATION |
-----------------------

HPLIP-Version: HPLIP 3.19.12
HPLIP-Home: /usr/share/hplip
warning: HPLIP-Installation: Auto installation is not supported for 0 distro 6.7.0-devel-20240722120714-build.0 version

Current contents of '/etc/hp/hplip.conf' file:
# hplip.conf. Generated from hplip.conf.in by configure.

[hplip]
version=3.19.12

[dirs]
home=/usr/share/hplip
run=/var/run
ppd=/usr/share/ppd/HP
ppdbase=/usr/share/ppd
doc=/usr/share/doc/hplip-3.19.12
html=/usr/share/doc/hplip-3.19.12
icon=/usr/share/applications
cupsbackend=/usr/libexec/cups/backend
cupsfilter=/usr/libexec/cups/filter
drv=/usr/share/cups/drv/hp
bin=/usr/bin
apparmor=/etc/apparmor.d
# Following values are determined at configure time and cannot be changed.
[configure]
network-build=no
libusb01-build=no
pp-build=no
gui-build=no
scanner-build=no
fax-build=no
dbus-build=no
cups11-build=no
doc-build=no
shadow-build=no
hpijs-install=no
foomatic-drv-install=yes
foomatic-ppd-install=no
foomatic-rip-hplip-install=no
hpcups-install=yes
cups-drv-install=yes
cups-ppd-install=yes
internal-tag=3.19.12
restricted-build=no
ui-toolkit=no
qt3=no
qt4=no
qt5=no
policy-kit=no
lite-build=no
udev_sysfs_rules=no
hpcups-only-build=no
hpijs-only-build=no
apparmor_build=no
class-driver=no

Current contents of '/var/lib/hp/hplip.state' file:
Plugins are not installed. Could not access file: No such file or directory

Current contents of '~/.hplip/hplip.conf' file:
warning: Could not access file: No such file or directory
 <Package-name> <Package-Desc> <Required/Optional> <Min-Version> <Installed-Version> <Status> <Comment>

-------------------------
| External Dependencies |
-------------------------

 cups CUPS - Common Unix Printing System REQUIRED 1.1 2.4.2 OK 'CUPS Scheduler is running'
 error: gs GhostScript - PostScript and PDF language interpreter and previewer REQUIRED 7.05 - MISSING 'gs needs to be installed'
 error: xsane xsane - Graphical scanner frontend for SANE OPTIONAL 0.9 - MISSING 'xsane needs to be installed'
 error: scanimage scanimage - Shell scanning program OPTIONAL 1.0 - MISSING 'scanimage needs to be installed'
 dbus DBus - Message bus system REQUIRED - 1.14.8 OK -
 error: policykit PolicyKit - Administrative policy framework OPTIONAL - - MISSING 'policykit needs to be installed'
 network network -wget OPTIONAL - - OK -
 avahi-utils avahi-utils OPTIONAL - 0.8 OK -

------------------------
| General Dependencies |
------------------------

 error: libjpeg libjpeg - JPEG library REQUIRED - - MISSING 'libjpeg needs to be installed'
 cups-devel CUPS devel- Common Unix Printing System development files REQUIRED - 2.4.2 OK -
 cups-image CUPS image - CUPS image development files REQUIRED - 2.4.2 OK -
 libpthread libpthread - POSIX threads library REQUIRED - b'2.35' OK -
 libusb libusb - USB library REQUIRED - 1.0 OK -
 error: sane SANE - Scanning library REQUIRED - - MISSING 'sane needs to be installed'
 error: sane-devel SANE - Scanning library development files REQUIRED - - MISSING 'sane-devel needs to be installed'
 error: libnetsnmp-devel libnetsnmp-devel - SNMP networking library development files REQUIRED 5.0.9 - MISSING 'libnetsnmp-devel needs to be installed'
 libcrypto libcrypto - OpenSSL cryptographic library REQUIRED - 3.0.14 OK -
 python3X Python 2.2 or greater - Python programming language REQUIRED 2.2 3.10.14 OK -
 error: python3-notify2 Python libnotify - Python bindings for the libnotify Desktop notifications OPTIONAL - - MISSING 'python3-notify2 needs to be installed'
 error: python3-pyqt4-dbus PyQt 4 DBus - DBus Support for PyQt4 OPTIONAL 4.0 - MISSING 'python3-pyqt4-dbus needs to be installed'
 error: python3-pyqt4 PyQt 4- Qt interface for Python (for Qt version 4.x) REQUIRED 4.0 - MISSING 'python3-pyqt4 needs to be installed'
 python3-dbus Python DBus - Python bindings for DBus REQUIRED 0.80.0 1.2.18 OK -
 python3-xml Python XML libraries REQUIRED - 2.6.0 OK -
 python3-devel Python devel - Python development files REQUIRED 2.2 3.10.14 OK -
Traceback (most recent call last):
  File "/usr/bin/hp-check", line 862, in <module>
    num_errors, num_warns = dep.validate(time_flag, is_quiet_mode)
  File "/usr/bin/hp-check", line 367, in validate
    self.__update_deps_info(supported_distro_vrs, dep,
  File "/usr/bin/hp-check", line 210, in __update_deps_info
    installed_ver = self.core.version_func[deps_info[6]]()
  File "/usr/share/hplip/installer/dcheck.py", line 373, in get_pil_version
    return Image.PILLOW_VERSION
  File "/usr/lib/python3.10/site-packages/PIL/Image.py", line 79, in __getattr__
    raise AttributeError(msg)
AttributeError: module 'PIL.Image' has no attribute 'PILLOW_VERSION'

    4. A Detailed explanation of your problem
We have bitbake following commands .I am also sharing hplip_3.19.12.bb file for reference .We are still unable to print even though command is sent.
    • Add the following in .bb file
" hplip cups \ pkgconfig \ python3 \ python3-pip \ python3-distro \ python3-dbus \ cups-doc \ cups-lib \ cups-libimage \ cups-filters \ hplip-ppd \ hplip-cups \ hplip-backend \ hplip-filter \ vsftpd \ "
    • We have added meta- custom layer .
bitbake-layers add-layer ../sources/meta-custom
Bitbake was successful.

Following command are working

# lpinfo -v
  network beh
file cups-brf:/
network lpd
direct hp:/usb/HP_LaserJet_Professional_P1108?serial=000000000QND6D60PR1a
network socket
serial serial:/dev/ttyS4?baud=115200
network ipp
network https
network ipps
network http
direct usb://HP/LaserJet%20Professional%20P1108?serial=000000000QND6D60PR1a
direct hpfax
check the available printer drivers # lpinfo -m
     -List all drivers add the printer name # lpadmin -p HP_LaserJet_Professional_P1108
#add the printer name .ppd
lpadmin -p HP_LaserJet_Professional_P1108 -E -v usb://HP/LaserJet_Professional_P1108?serial=000000000QND6D60PR1a -m drv:///hp/hpcups.drv/hp-laserjet_professional_p1108.ppd
Now add the printer as the default printer # lpoptions -d HP_LaserJet_Professional_P1108
Check the default printer
# lpstat -d
system default destination: HP_LaserJet_Professional_P1108
        Following command are not working
       Now print a file/pdf
# lp -d HP_LaserJet_Professional_P1108 test.pdf

5.apalis-imx8-14904058:~$ hp-doctor
/usr/share/hplip/installer/core_install.py:2074: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if home_dir is "":
/usr/share/hplip/check.py:685: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 'getfacl' not in g and '' is not g and 'file' not in g:

HP Linux Imaging and Printing System (ver. 3.19.12)
Self Diagnse Utility and Healing Utility ver. 1.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.

HP Linux Imaging and Printing System (ver. 3.19.12)
Self Diagnse Utility and Healing Utility ver. 1.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.

warning: tdx wayland with xwayland distro is not found in AUTH_TYPES

Checking for Deprecated items....
error: This distro (i.e unknown 6.7.0-devel-20240722120714-build.0) is either deprecated or not yet supported.
The diagnosis is limited on unsupported platforms. Do you want to continue?(y=yes*, n=no):yes
error: Please enter 'y', 'n', 'q' or press <enter> for the default of 'y'.
The diagnosis is limited on unsupported platforms. Do you want to continue?(y=yes*, n=no):y

Checking for HPLIP updates....
sh: line 1: /usr/bin/hp-upgrade: No such file or directory
error: Failed to upgrade latest HPLIP. Is hp-upgrade already running (i.e. foreground or background)?

Checking for Dependencies....
warning: 0-6.7.0-devel-20240722120714-build.0 version is not supported. Using 0-0 versions dependencies to verify and install...

---------------
| SYSTEM INFO |
---------------

 Kernel: 5.15.148-6.7.0-devel+git.bfdbfb2c85fb #1 SMP PREEMPT Thu Jun 20 15:59:41 UTC 2024 GNU/Linux
 Host: apalis-imx8-14904058
 Proc: 5.15.148-6.7.0-devel+git.bfdbfb2c85fb #1 SMP PREEMPT Thu Jun 20 15:59:41 UTC 2024 GNU/Linux
 Distribution: 0 6.7.0-devel-20240722120714-build.0
 Bitness: 64 bit

-----------------------
| HPLIP CONFIGURATION |
-----------------------

HPLIP-Version: HPLIP 3.19.12
HPLIP-Home: /usr/share/hplip
warning: HPLIP-Installation: Auto installation is not supported for 0 distro 6.7.0-devel-20240722120714-build.0 version

Current contents of '/etc/hp/hplip.conf' file:
# hplip.conf. Generated from hplip.conf.in by configure.

[hplip]
version=3.19.12

[dirs]
home=/usr/share/hplip
run=/var/run
ppd=/usr/share/ppd/HP
ppdbase=/usr/share/ppd
doc=/usr/share/doc/hplip-3.19.12
html=/usr/share/doc/hplip-3.19.12
icon=/usr/share/applications
cupsbackend=/usr/libexec/cups/backend
cupsfilter=/usr/libexec/cups/filter
drv=/usr/share/cups/drv/hp
bin=/usr/bin
apparmor=/etc/apparmor.d
# Following values are determined at configure time and cannot be changed.
[configure]
network-build=no
libusb01-build=no
pp-build=no
gui-build=no
scanner-build=no
fax-build=no
dbus-build=no
cups11-build=no
doc-build=no
shadow-build=no
hpijs-install=no
foomatic-drv-install=yes
foomatic-ppd-install=no
foomatic-rip-hplip-install=no
hpcups-install=yes
cups-drv-install=yes
cups-ppd-install=yes
internal-tag=3.19.12
restricted-build=no
ui-toolkit=no
qt3=no
qt4=no
qt5=no
policy-kit=no
lite-build=no
udev_sysfs_rules=no
hpcups-only-build=no
hpijs-only-build=no
apparmor_build=no
class-driver=no

Current contents of '/var/lib/hp/hplip.state' file:
Plugins are not installed. Could not access file: No such file or directory

Current contents of '~/.hplip/hplip.conf' file:
[installation]
date_time = 04/28/22 17:58:45
version = 3.19.12

 <Package-name> <Package-Desc> <Required/Optional> <Min-Version> <Installed-Version> <Status> <Comment>

-------------------------
| External Dependencies |
-------------------------

 cups CUPS - Common Unix Printing System REQUIRED 1.1 2.4.2 OK 'CUPS Scheduler is running'
 gs GhostScript - PostScript and PDF language interpreter and previewer REQUIRED 7.05 9.55.0 OK -
 error: xsane xsane - Graphical scanner frontend for SANE OPTIONAL 0.9 - MISSING 'xsane needs to be installed'
 error: scanimage scanimage - Shell scanning program OPTIONAL 1.0 - MISSING 'scanimage needs to be installed'
 dbus DBus - Message bus system REQUIRED - 1.14.8 OK -
 error: policykit PolicyKit - Administrative policy framework OPTIONAL - 0.119 MISSING 'policykit needs to be installed'
 network network -wget OPTIONAL - - OK -
 avahi-utils avahi-utils OPTIONAL - 0.8 OK -

------------------------
| General Dependencies |
------------------------

 error: libjpeg libjpeg - JPEG library REQUIRED - - MISSING 'libjpeg needs to be installed'
 cups-devel CUPS devel- Common Unix Printing System development files REQUIRED - 2.4.2 OK -
 cups-image CUPS image - CUPS image development files REQUIRED - 2.4.2 OK -
 libpthread libpthread - POSIX threads library REQUIRED - b'2.35' OK -
 libusb libusb - USB library REQUIRED - 1.0 OK -
 error: sane SANE - Scanning library REQUIRED - - MISSING 'sane needs to be installed'
 error: sane-devel SANE - Scanning library development files REQUIRED - - MISSING 'sane-devel needs to be installed'
 libnetsnmp-devel libnetsnmp-devel - SNMP networking library development files REQUIRED 5.0.9 5.9.3 OK -
 libcrypto libcrypto - OpenSSL cryptographic library REQUIRED - 3.0.14 OK -
 python3X Python 2.2 or greater - Python programming language REQUIRED 2.2 3.10.14 OK -
 error: python3-notify2 Python libnotify - Python bindings for the libnotify Desktop notifications OPTIONAL - - MISSING 'python3-notify2 needs to be installed'
 error: python3-pyqt4-dbus PyQt 4 DBus - DBus Support for PyQt4 OPTIONAL 4.0 - MISSING 'python3-pyqt4-dbus needs to be installed'
 error: python3-pyqt4 PyQt 4- Qt interface for Python (for Qt version 4.x) REQUIRED 4.0 - MISSING 'python3-pyqt4 needs to be installed'
 python3-dbus Python DBus - Python bindings for DBus REQUIRED 0.80.0 1.2.18 OK -
 python3-xml Python XML libraries REQUIRED - 2.6.0 OK -
 python3-devel Python devel - Python development files REQUIRED 2.2 3.10.14 OK -
Traceback (most recent call last):
  File "/usr/bin/hp-doctor", line 297, in <module>
    num_errors, num_warns = dep.validate(DEPENDENCY_RUN_AND_COMPILE_TIME, False)
  File "/usr/share/hplip/check.py", line 367, in validate
    self.__update_deps_info(supported_distro_vrs, dep,
  File "/usr/share/hplip/check.py", line 210, in __update_deps_info
    installed_ver = self.core.version_func[deps_info[6]]()
  File "/usr/share/hplip/installer/dcheck.py", line 373, in get_pil_version
    return Image.PILLOW_VERSION
  File "/usr/lib/python3.10/site-packages/PIL/Image.py", line 79, in __getattr__
    raise AttributeError(msg)
AttributeError: module 'PIL.Image' has no attribute 'PILLOW_VERSION'
apalis-imx8-14904058:~$
6. i am sharing my yocto image receipe :-
    • python3 \
    • python3-pip \
    • python3-distro \
    • python3-dbus \
    • cups-dev \
    • cups \
    • cups-doc \
    • cups-lib \
    • cups-libimage \
    • cups-dev \
    • cups-filters \
    • hplip \
    • hplip-ppd \
    • hplip-cups \
    • hplip-backend \
    • hplip-filter \
    • vsftpd \
    • ghostscript \
    • libjpeg-turbo \
    • net-snmp-dev \
    • polkit \
    • python3-pyqt5 \
    • python3-pillow \

Still i am unable to print using usb

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.