Installed python-z3-solver is not detected as a Python module
Description:
After python-z3-solver is installed, it is not recognized as a Python module when listed with pip --list. Other Arch packages are listed there. z3-solve is usable in Python programs but if developing with a requirement for z3-solver, pip/pipx will install another copy of z3 despite there being a system version available.
Steps to reproduce:
- Install
python-z3-solverpackage - Create a minimal
pyproject.tomlwith the following contents:
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"
[project]
name = "test-z3"
dependencies = [
"z3-solver"
]
- Run
pip --listand note thatz3-solverdoes not appear - Run
pip install --break-system-packages --user .
pip will install a local copy of z3-solver in ~/.local/lib/python3.11/site-packages despite it being installed system-wide (remove using pip uninstall --break-system-packages z3-solver)
Fix:
I believe that instead of compiling using cmake and ninja, it would be better to follow https://wiki.archlinux.org/title/Python_package_guidelines#Standards_based_(PEP_517), and run python -m build --wheel --no-isolation -x in src/api/python in the Z3 sources.