Hace un tiempo me dejó de funcionar la aplicación [notifymuch](https://github.com/kspi/notifymuch.git), para mostrar notificaciones de correos nuevos en notmuch. Lo siguiente es en GNU/Linux Debian Trixie con Python 3.12.

La recomendación para instalarlo es ejecutar (desde el directorio clonado):

$ pip install .

Pero ese comando da el error:

error: externally-managed-environment

× This environment is externally managed

╰─> To install Python packages system-wide, try apt install

python3-xyz, where xyz is the package you are trying to

install.

If you wish to install a non-Debian-packaged Python package,

create a virtual environment using python3 -m venv path/to/venv.

Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make

sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,

it may be easiest to use pipx install xyz, which will manage a

virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.

hint: See PEP 668 for the detailed specification.

Entonces, para no tener que crear un entorno virtual manualmente, instalamos el programa pipx (crea automáticamente el entorno virual) y los siguientes paquetes (quizás falten otras cosas):

$ sudo apt install pipx python3-cairo-dev libcairo2-dev python-gi-dev gobject-introspection

Ejecutamos:

$ pipx install .

Luego hay que hacer unos cambios en el paquete instalado por cuestiones de compatibilidad con Python 3.12:

- [SafeConfigParser no está más desde Python 3.11](https://github.com/pyupio/dparse/issues/51), usar RawConfigParser.

- [El método readfp de configparser se removió](https://github.com/Klipper3d/klipper/pull/6388), usar read_file().

Para solucionarlo, en el directorio $HOME/.local/share/pipx/venvs/notifymuch/lib/python3.12/site-packages/notmuch ejecutar:

$ sed --in-place "s/SafeConfigParser/RawConfigParser/g" compat.py

$ sed --in-place "s/SafeConfigParser/RawConfigParser/g" database.py

$ sed --in-place "s/readfp/read_file/g" database.py

Quizás a alguien le sirva....

Reply to this note

Please Login to reply.

Discussion

No replies yet.