Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'jinja2' #146

Open
12D687 opened this issue Nov 22, 2024 · 5 comments
Open

ModuleNotFoundError: No module named 'jinja2' #146

12D687 opened this issue Nov 22, 2024 · 5 comments

Comments

@12D687
Copy link

12D687 commented Nov 22, 2024

Output of bubblejail --version

0.9.3

Your distro name and version

Debian

Description

Command meson compile fails, even though the jinja2 has already been installed:

The Meson build system
Version: 1.6.0
Source dir: /home/user/Downloads/bubblejail-0.9.3
Build dir: /home/user/Downloads/bubblejail-0.9.3/build
Build type: native build
Project name: bubblejail
Project version: 0.9.3
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/usr/bin/python3)
Message: Using non site-packages directory /usr/local/lib/bubblejail/python-packages
Program scdoc found: NO
Program man_generator.py found: YES (/home/user/.local/pipx/venvs/meson/bin/python -B /home/user/Downloads/bubblejail-0.9.3/docs/man_generator.py)
Program jinja2_run.py found: YES (/home/user/.local/pipx/venvs/meson/bin/python -B /home/user/Downloads/bubblejail-0.9.3/tools/jinja2_run.py)
Build targets in project: 5

Found ninja-1.11.1 at /usr/bin/ninja

INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja
[1/3] Generating tools/bubblejail_gui_...d (wrapped by meson to capture output)
FAILED: tools/bubblejail-config
/home/user/.local/bin/meson --internal exe --capture tools/bubblejail-config -- /home/user/.local/pipx/venvs/meson/bin/python -B /home/user/Downloads/bubblejail-0.9.3/tools/jinja2_run.py --template-dir /home/user/Downloads/bubblejail-0.9.3/templates --define SHARE_PREFIX /usr/local/share --define LIB_PREFIX /usr/local/lib/x86_64-linux-gnu --define BUBBLEJAIL_VERSION 0.9.3 --define SYSCONF_DIR /etc --define PYTHON_SHEBANG_SHORT_OPTS I --define PYTHON_PACKAGES_DIR /usr/local/lib/bubblejail/python-packages bubblejail_launch_gui_qt.py.jinja
--- stderr ---
Traceback (most recent call last):
File "/home/user/Downloads/bubblejail-0.9.3/tools/jinja2_run.py", line 10, in
from jinja2 import Environment, FileSystemLoader, StrictUndefined
ModuleNotFoundError: No module named 'jinja2'

[2/3] Generating tools/bubblejail_help...d (wrapped by meson to capture output)
FAILED: tools/bubblejail-helper
/home/user/.local/bin/meson --internal exe --capture tools/bubblejail-helper -- /home/user/.local/pipx/venvs/meson/bin/python -B /home/user/Downloads/bubblejail-0.9.3/tools/jinja2_run.py --template-dir /home/user/Downloads/bubblejail-0.9.3/templates --define SHARE_PREFIX /usr/local/share --define LIB_PREFIX /usr/local/lib/x86_64-linux-gnu --define BUBBLEJAIL_VERSION 0.9.3 --define SYSCONF_DIR /etc --define PYTHON_SHEBANG_SHORT_OPTS I --define PYTHON_PACKAGES_DIR /usr/local/lib/bubblejail/python-packages bubblejail_launch_helper.py.jinja
--- stderr ---
Traceback (most recent call last):
File "/home/user/Downloads/bubblejail-0.9.3/tools/jinja2_run.py", line 10, in
from jinja2 import Environment, FileSystemLoader, StrictUndefined
ModuleNotFoundError: No module named 'jinja2'

[3/3] Generating tools/bubblejail_cli_...d (wrapped by meson to capture output)
FAILED: tools/bubblejail
/home/user/.local/bin/meson --internal exe --capture tools/bubblejail -- /home/user/.local/pipx/venvs/meson/bin/python -B /home/user/Downloads/bubblejail-0.9.3/tools/jinja2_run.py --template-dir /home/user/Downloads/bubblejail-0.9.3/templates --define SHARE_PREFIX /usr/local/share --define LIB_PREFIX /usr/local/lib/x86_64-linux-gnu --define BUBBLEJAIL_VERSION 0.9.3 --define SYSCONF_DIR /etc --define PYTHON_SHEBANG_SHORT_OPTS I --define PYTHON_PACKAGES_DIR /usr/local/lib/bubblejail/python-packages bubblejail_launch_cli.py.jinja
--- stderr ---
Traceback (most recent call last):
File "/home/user/Downloads/bubblejail-0.9.3/tools/jinja2_run.py", line 10, in
from jinja2 import Environment, FileSystemLoader, StrictUndefined
ModuleNotFoundError: No module named 'jinja2'

ninja: build stopped: subcommand failed.

@igo95862
Copy link
Owner

Hello @12D687

Is jinja installed in your pipx venv or your system site-packages?

@12D687
Copy link
Author

12D687 commented Nov 22, 2024

Neither. It is installed locally
/home/user/.local/lib/python3.11/site-packages

@igo95862
Copy link
Owner

You probably need to install it in to the same venv as your meson.

@12D687
Copy link
Author

12D687 commented Nov 23, 2024

Yes it worked, but now I'm unable to install it

ninja: Entering directory `/home/user/Downloads/bubblejail-0.9.3/build'
ninja: no work to do.
Installing subdir /home/user/Downloads/bubblejail-0.9.3/data/usr-share/bubblejail to /usr/local/share/bubblejail
Installation failed due to insufficient permissions.
Attempt to use /usr/bin/sudo to gain elevated privileges? [y/n] y
Traceback (most recent call last):
File "/home/user/.local/bin/meson", line 5, in
from mesonbuild.mesonmain import main
ModuleNotFoundError: No module named 'mesonbuild'

@igo95862
Copy link
Owner

Probably because then meson uses sudo it will no longer be able to use your venv.

I did not test using the venv to install bubblejail. I think I will revisit using pipx and venv for non-packaged downloads in the future to replace the meson install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants