Artix Linux Forum

Artix Linux => Package management => Topic started by: k4lizen on 17 January 2025, 03:01:09

Title: python-poetry package depends on libpython3.12.so.1.0
Post by: k4lizen on 17 January 2025, 03:01:09
`pacman -Ss python-poetry`:
Code: [Select]
world/python-poetry 1.8.5-1 [installed]
    Python dependency management and packaging made easy
world/python-poetry-core 1.9.1-1 (python-build-backend) [installed]
    Poetry PEP 517 Build Backend & Core Utilities
world/python-poetry-dynamic-versioning 1.4.1-2
    Plugin for Poetry to enable dynamic versioning based on VCS tags
world/python-poetry-plugin-export 1.8.0-3 [installed]
    Poetry plugin to export the dependencies to various formats
extra/python-poetry 1.8.5-1 [installed]
    Python dependency management and packaging made easy
extra/python-poetry-core 1.9.1-1 (python-build-backend) [installed]
    Poetry PEP 517 Build Backend & Core Utilities
extra/python-poetry-dynamic-versioning 1.4.1-2
    Plugin for Poetry to enable dynamic versioning based on VCS tags
extra/python-poetry-plugin-export 1.8.0-3 [installed]
    Poetry plugin to export the dependencies to various formats
extra/python-poetry-plugin-up 0.8.0-1
    Poetry plugin that updates dependencies and bumps their versions in pyproject.toml file
When running poetry:
Code: [Select]
~> poetry
/home/user/.local/share/pypoetry/venv/bin/python: error while loading shared libraries: libpython3.12.so.1.0: cannot open shared object file: No such file or directory
Package was last updated: 2024-12-26
I tried reinstalling a few times, doesn't seem to help.
Title: Re: python-poetry package depends on libpython3.12.so.1.0
Post by: corysanin on 17 January 2025, 03:38:57
What's your python version?
Title: Re: python-poetry package depends on libpython3.12.so.1.0
Post by: k4lizen on 17 January 2025, 15:29:32
Code: [Select]
~> python --version
Python 3.13.1
~>  pacman -Ss ^python\$
system/python 3.13.1-1 [installed]
    The Python programming language
Title: Re: python-poetry package depends on libpython3.12.so.1.0
Post by: corysanin on 17 January 2025, 22:42:46
Actually I see the issue. The python executable it's using is in your venv and that appears to linked to an old libpython3. I'm sure if you reinitialize your venv or force poetry to use the python installed by pacman it'll work.
Title: Re: python-poetry package depends on libpython3.12.so.1.0
Post by: n00b on 18 January 2025, 03:21:08
Actually I see the issue. The python executable it's using is in your venv and that appears to linked to an old libpython3. I'm sure if you reinitialize your venv or force poetry to use the python installed by pacman it'll work.
for the noobs, how would you do that?
Title: Re: python-poetry package depends on libpython3.12.so.1.0
Post by: corysanin on 18 January 2025, 06:16:34
Python's not really my strong suit. But my guess would be to get rid of ~/.local/share/pypoetry/venv/. Might want to try moving that venv directory before deleting it. This might actually be terrible advice.

Hopefully anyone who runs into this knows how the venv got there and would therefore know how to replace it with a fresh one.

Spoiler (click to show/hide)
Title: Re: python-poetry package depends on libpython3.12.so.1.0
Post by: LemonPie on 18 January 2025, 14:07:20
to setup a venv that reliable after python system upgrade, I recommend using a python version manager that bundles python. i.e. uv (https://packages.artixlinux.org/packages/world/x86_64/uv/)
Title: Re: python-poetry package depends on libpython3.12.so.1.0
Post by: k4lizen on 18 January 2025, 19:25:24
to setup a venv that reliable after python system upgrade, I recommend using a python version manager that bundles python. i.e. uv (https://packages.artixlinux.org/packages/world/x86_64/uv/)
in my case that's not really an option as the project I'm using uses poetry as a part of it's build system, though I am hyped about uv.

It seems I originally installed poetry with their install script `curl -sSL https://install.python-poetry.org | python3 -`. The script documents that it installs itself in `~/.local/bin/poetry` and `~/.local/share/pypoetry` so I removed those and reinstalled the packages from artix and now everything seems to work. Thanks @corysanin you were right essentially.