Open mmngreco opened 2 years ago
This is really weird. I was able to duplicate this locally too:
pipx uninstall lookatme
# to double check - make sure that lookatme's venv isn't present anymore: ls ~/.local/pipx/venvs
# now install lookatme again
pipx install lookatme
# see that there isn't an image_ueberzug.py in the contrib folder:
ls ~/.local/pipx/venvs/lookatme/lib/python*/site-packages/lookatme/contrib
# output> file_loader.py __init__.py __pycache__ terminal.py
# see the expected error manually activating the lookatme pipx venv
(. ~/.local/pipx/venvs/lookatme/bin/activate && python3 -c "import lookatme.contrib.image_ueberzug")
# output> Traceback (most recent call last): │
# output> File "<string>", line 1, in <module> │
# output> ModuleNotFoundError: No module named 'lookatme.contrib.image_ueberzug'
pipx runpip lookatme install lookatme.contrib.image_ueberzug
# this doesn't error anymore!
(. ~/.local/pipx/venvs/lookatme/bin/activate && python3 -c "import lookatme.contrib.image_ueberzug")
# So it SHOULD work with pipx run lookatme ....
pipx run lookatme slideshow_with_image_ueberzug.md # errors
# output> ...
# output> No module named 'lookatme.contrib.image_ueberzug'
# But it DOES work manually activating the environment and running lookatme
(. ~/.local/pipx/venvs/lookatme/bin/activate && lookatme slideshow_with_image_ueberzug.md)
As far as I can tell, this isn't something that is lookatme's fault. lookatme is using the normal import system to import the fully-qualified contrib module (code link):
module_name = f"lookatme.contrib.{contrib_name}"
try:
mod = __import__(module_name, fromlist=[contrib_name])
except Exception as e:
if ignore_load_failure:
continue
errors.append(str(e))
Describe the bug
Apparently when I run lookatme the extension ueberzug cannot be found as it tries to import it from system environment.
To Reproduce
Steps to reproduce the behavior:
pipx install lookatme
pipx runpip lookatme install lookatme.contrib.image_ueberzug
lookatme ./readme.md
readme.md
traceback
Environment (please complete the following information):
lookatme --version
] lookatme, version 2.3.2Additional context
Workaround (this is not what I like to do as I prefer to have all my CLI isolated in differents venvs which is what pipx does).