[Python] How can I use apt-get install packages in a python versions installed by pyenv?

Discussão em 'Python' iniciado por Stack, Junho 4, 2025.

  1. Stack

    Stack Membro Participativo

    I need help to install a package using apt install in the Raspberry Pi using the python version I installed using pyenv. I already tried using pip, but the installation fails. The specific package I tried to install is pyqt5, for more info. The code is running in a Raspberry Pi OS 12 bookworm.

    My goal is to use the most recent python version installed with pyenv to create a virtual environment, development environment, and use `-system-site-packages to transfer the package. The problem is that apt install always sees the system OS installation of Python, which is several versions behind the one we use for development.

    I found a person asking the same question in github without getting a solution 8 years ago. I hope things have evolved for the better. Contributions are appreciated and I can provide more info if needed.

    Continue reading...

Compartilhe esta Página