Problems installing python package

Hi all,

I’m trying to install the InteractiveHtmlBom python module, so I first try :

python3 -m pip install InteractiveHtmlBom

And get the message about an extrernally managed environment, with the suggestion to use pipx.

So now I try : pipx install InteractiveHtmlBom
This sits there chugugging for a while and finally comes back with a bunch of errors

Fatal error from pip prevented installation. Full pip output in file:
    path to file/cmd_2023-12-18_23.11.15_pip_errors.log

pip failed to build package:
    wxpython

Some possibly relevant errors from pip install:
    python-config                            : not found
    Checking for library python3.11 in LIBDIR : not found
    Checking for library python3.11 in python_LIBPL : not found
    Checking for library python3.11 in $prefix/libs : not found
    Checking for library python3.11 in $INCLUDEPY/../libs : not found
    Checking for library python3.11m in LIBDIR            : not found
    Checking for library python3.11m in python_LIBPL      : not found
    Checking for library python3.11m in $prefix/libs      : not found
    Checking for library python3.11m in $INCLUDEPY/../libs : not found
    Checking for library python311 in LIBDIR               : not found
    Checking for library python311 in python_LIBPL         : not found
    Checking for library python311 in $prefix/libs         : not found
    Checking for library python311 in $INCLUDEPY/../libs   : not found

Error installing interactivehtmlbom.

I tried looking in yast for python-config but it doesn’t seem to be there?

Where is it? Or what do I need to do to proceed.

Cheers.

Phill.

@phillhs pip can be fraught with issues… It’s built as an rpm if you want to download (Requires openSUSE Build Service login as I don’t publish packages)…

https://build.opensuse.org/package/show/home:malcolmlewis:TESTING/python-InteractiveHtmlBom

Did you look in this file?

You most likely need development environment to compile binary extensions during installation. OTOH the python-wxPython is already provided by Tumbleweed. Did you check prerequisites for your module?

Just tried installing your package and get :

rpm -Uvh ~afra/Downloads/python311-InteractiveHtmlBom-2.8.1-1.1.noarch.rpm 
warning: /net/aurigae/home/afra/Downloads/python311-InteractiveHtmlBom-2.8.1-1.1.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 479de3c9: NOKEY
error: Failed dependencies:
	python311-wxpython is needed by python311-InteractiveHtmlBom-2.8.1-1.1.noarch

Checked in YaST and python311-wxPython is installed though note the ‘P’ is capitalized, in wxPython.

zypper search python311-wxpython
Loading repository data...
Reading installed packages...

S | Name               | Summary                                    | Type
--+--------------------+--------------------------------------------+-----------
i | python311-wxPython | The "Phoenix" variant of the wxWidgets P-> | package
  | python311-wxPython | The "Phoenix" variant of the wxWidgets P-> | srcpackage

Cheers.

Phill.

Hi, tried the same command in my system and got the same error. The log file complains about missing gtk3 development files. So:

  1. I run sudo zypper in -C 'pkgconfig(gtk+-3.0)' and now the error becomes about missing Python 3.11 development files
  2. I run sudo zypper in python311-devel and now the compilation fails due to incompatibilities in the expected and provided headers. I suppose that the wxPython version required by InteractiveHtmlBom doesn’t compile for Python 3.11…

In general, I suggest you use pyenv for handling python stuffs. Distro packages are better for software depending on them, not for installing pure-python applications.

@phillhs my bad, all fixed and rebuilding :smile:

Actually, InteractiveHtmlBom requires wxPython>=4.0 and since 4.2 Python 3.11 should be supported and the one that is being compilid is 4.2.1. So, something is not working. Don’t know if it’s an issue with wxPython or with openSUSE’s Python 3.11-devel package

If you could do a try with this commands, maybe we understand what’s going on and add it to the wiki

@00sapo runs here fine (need a test file)… it pulls in all the required dependencies

libwx_baseu-suse9_0_0 libwx_baseu_net-suse9_0_0 libwx_baseu_xml-suse9_0_0 libwx_gtk3u_aui-suse9_0_0 libwx_gtk3u_core-suse9_0_0 libwx_gtk3u_gl-suse9_0_0 libwx_gtk3u_html-suse9_0_0
libwx_gtk3u_media-suse9_0_0 libwx_gtk3u_propgrid-suse9_0_0 libwx_gtk3u_ribbon-suse9_0_0 libwx_gtk3u_richtext-suse9_0_0 libwx_gtk3u_stc-suse9_0_0 libwx_gtk3u_webview-suse9_0_0
libwx_gtk3u_xrc-suse9_0_0 python311-InteractiveHtmlBom python311-wxPython

generate_interactive_bom 
usage: generate_interactive_bom [-h] [--show-dialog] [--version] [--dark-mode] [--hide-pads] [--show-fabrication] [--hide-silkscreen] [--highlight-pin1 [{none,all,selected}]]
                                [--no-redraw-on-drag] [--board-rotation BOARD_ROTATION] [--offset-back-rotation] [--checkboxes CHECKBOXES] [--bom-view {bom-only,left-right,top-bottom}]
                                [--layer-view {F,FB,B}] [--no-compression] [--no-browser] [--dest-dir DEST_DIR] [--name-format NAME_FORMAT] [--include-tracks] [--include-nets]
                                [--sort-order SORT_ORDER] [--blacklist BLACKLIST] [--no-blacklist-virtual] [--blacklist-empty-val] [--netlist-file NETLIST_FILE]
                                [--extra-data-file EXTRA_DATA_FILE] [--extra-fields EXTRA_FIELDS] [--show-fields SHOW_FIELDS] [--group-fields GROUP_FIELDS] [--normalize-field-case]
                                [--variant-field VARIANT_FIELD] [--variants-whitelist VARIANTS_WHITELIST] [--variants-blacklist VARIANTS_BLACKLIST] [--dnp-field DNP_FIELD]
                                file

One solution would be to install all the build dependencies of the official python-wxpython package.

It would be something like this (not tested)

sudo zypper in 'freeglut-devel' 'gstreamer-plugins-base-devel' 'libjbig-devel' 'pkgconfig(gstreamer-1.0)' 'pkgconfig(gtk+-3.0)' 'pkgconfig(libjpeg)' 'pkgconfig(liblzma)' 'pkgconfig(libmspack)' 'pkgconfig(libnotify)' 'pkgconfig(libpng16)' 'pkgconfig(libtiff-4)' 'pkgconfig(sdl2)' 'pkgconfig(sm)' 'pkgconfig(webkit2gtk-4.0)' 'pkgconfig(x11)' 'pkgconfig(xtst)' 'c++_compiler' 'fdupes' 'pkgconfig' 'python-rpm-macros' 'python311' 'python11-devel' 'python311-requests' 'python311-setuptools' 'python311-numpy' 'python311-six' 'python311-pytest' 'python311-pytest-xdist' 'python311-pytest-forked' 'pkgconfig(cppunit)' 'google-opensans-fonts'

After this, pipx should work.
Not sure if it makes sense, though, it’s better using opi maybe.

@00sapo rather than pollute the host system, look at using distrobox…

I think pipx install --system-site-packages is what we’re looking for… So we can use sudo zypper in python311-wxpython to avoid compiling it

@00sapo I would not recommend installing in the host system, like I indicated, as your user, or use a distrobox instance those are easy to fix…

Why not? Pipx is the recommended way to install python packages.

What I’m saying (and what I would add to the wiki) is:

When you have a complex dependency that must be compiled in a pipx package, such as wxPython, you can install the dependency using the openSUSE repositories, for instance:

sudo zypper in python311-wxPython

Then, you can use the --system-site-packages option of pipx to force it using the pre-compiled openSUSE package instead of compiling it:

pipx install --system-site-packages InteractiveHtmlBom

I tried and it works nicely. Much better than polluting the OS with home: packages and/or distrobox instances IMHO…

@00sapo please understand, this is openSUSE, good luck doing that on MicroOS :wink: Use distrobox and have at it there…

System packages are a lot easier for new users to handle, and happy to support, they are easy to create, install and uninstall, even at a user level with py2pack.

@phillhs If it all works as required (perhaps you could create a test file for me?) I’m happy to push to the distribution for you.

Weird, no one is suggesting installing Python packages in the root of the filesystem anymore… even the openSUSE command suggests using pipx. Why this would be bad in MicroOS (never used it, AFAIK, it would only need transactional updates for installing RPM packages, isn’t it?)

@00sapo MicroOS is all about distrobox/podman for the end user (and flatpaks), leave the OS to do it’s thing.

If you want a system package it’s just two steps transactional-update pkg install <foo> the transactional-update apply to move to the next snapshot, no reboot required.

Yep, so my approach of zypper in or transactional-update pkg install + pipx install --system-site-packages should work, isn’t it? The thing is that if the user installs all the Python software in the same environment (the root of the filesystem in this case) it will soon find incompatibilities among packages. This is why pipx exists, actually.

@00sapo The file system is immutable, your second command probably won’t work, it likely would need doing from a transactional-update shell, exit and reboot… but test and see what works…

Not really, they are methods employed to get around system administration restrictions, so only the user $HOME will get borked :wink:

Pipx description: “Install and Run Python Applications in Isolated Environments”

Anyway, the OP is using Tumbleweed, hence the packaging response, if the user was on MicroOS, I would recommend distrobox, install there and run, which ever method is used…