I have encountered a question about Jinja2 package now. I hope you can take the time to help me answer it. Thank you!

127 views
Skip to first unread message

Jay Ironman

unread,
Sep 16, 2023, 10:24:23 AM9/16/23
to S2E Developer Forum
  • Firstly, I have successfully built the virtual machine image of ubuntu now:
Saving snapshot ready and exiting
Saving VM (ready)!
s2e-block: dirty at save: 17120
skipping non-regular file "var/snap/lxd/common/lxd-user/unix.socket"
skipping non-regular file "var/snap/lxd/common/lxd/unix.socket"
# Some files might not have read privileges, add them here
chmod -R u+r /home/iie-iisd/s2e/images/ubuntu-22.04-x86_64/guestfs
[2023年 09月 16日 星期六 22:05:31 CST] [ubuntu-22.04-x86_64] Guestfs extraction completed.
cp "/home/iie-iisd/s2e/images/.tmp-output/linux-4.9.3-x86_64/"*/vmlinux "/home/iie-iisd/s2e/images/ubuntu-22.04-x86_64/guestfs/vmlinux"
[2023年 09月 16日 星期六 22:05:37 CST] [/home/iie-iisd/s2e/images/ubuntu-22.04-x86_64/image.json] Creating image descriptor...
/home/iie-iisd/s2e/source/guest-images//scripts/generate_image_descriptor.py -i /home/iie-iisd/s2e/source/guest-images//images.json -o /home/iie-iisd/s2e/images/ubuntu-22.04-x86_64/image.json -n "ubuntu-22.04-x86_64" snapshot="ready" qemu_build="x86_64" memory="256M" qemu_extra_flags="-net none -net nic,model=e1000 "
make: 离开目录“/home/iie-iisd/s2e/images”
SUCCESS: [image_build] Built image(s) 'ubuntu-22.04-x86_64'

  • Then I execute the following command to test (the ubuntu virtual machine image in the test is a directory)
$ s2e new_project -i /home/iie-iisd/s2e/images/ubuntu-22.04-x86_64 /home/iie-iisd/project/test-01/test-01
  • At present, there seems to be no problem, but after a while, an error was reported as follows:
ModuleNotFoundError: No module named 'jinja2'
  • It reminds me that I am missing the package for Jinja2, but I checked and found out that I have this package. Why is this problem still present?
[S2E:s2e] (venv) iie-iisd@vm:~/桌面/s2e-env$ pip list
Package    Version
---------- -------
Jinja2     3.1.2
MarkupSafe 2.1.3
pip        23.2.1
setuptools 59.6.0
  • I would greatly appreciate it if you could help me solve this problem!

Jay Ironman

unread,
Sep 16, 2023, 10:25:33 AM9/16/23
to S2E Developer Forum
  • All error messages are as follows:
Traceback (most recent call last):
  File "/usr/local/bin/s2e", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/s2e_env/manage.py", line 188, in main
    manager.execute()
  File "/usr/local/lib/python3.10/dist-packages/s2e_env/manage.py", line 177, in execute
    self.fetch_command(subcommand).run_from_argv(self._argv)
  File "/usr/local/lib/python3.10/dist-packages/s2e_env/manage.py", line 144, in fetch_command
    return load_command_class(subcommand)
  File "/usr/local/lib/python3.10/dist-packages/s2e_env/manage.py", line 62, in load_command_class
    module = importlib.import_module(f's2e_env.commands.{name}')
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.10/dist-packages/s2e_env/commands/new_project.py", line 31, in <module>
    from s2e_env.commands.project_creation import CGCProject, LinuxProject, AbstractProject
  File "/usr/local/lib/python3.10/dist-packages/s2e_env/commands/project_creation/__init__.py", line 25, in <module>
    from .abstract_project import AbstractProject
  File "/usr/local/lib/python3.10/dist-packages/s2e_env/commands/project_creation/abstract_project.py", line 38, in <module>
    from .utils import ConfigEncoder
  File "/usr/local/lib/python3.10/dist-packages/s2e_env/commands/project_creation/utils.py", line 25, in <module>
    from .target import Target
  File "/usr/local/lib/python3.10/dist-packages/s2e_env/commands/project_creation/target.py", line 28, in <module>
    from s2e_env.utils.templates import render_template
  File "/usr/local/lib/python3.10/dist-packages/s2e_env/utils/templates.py", line 27, in <module>
    from jinja2 import Environment, FileSystemLoader, StrictUndefined

ModuleNotFoundError: No module named 'jinja2'

Vitaly Chipounov

unread,
Sep 16, 2023, 1:03:41 PM9/16/23
to s2e...@googlegroups.com
Hi,

Make sure you run all the s2e commands inside an active venv.

Vitaly

--
You received this message because you are subscribed to the Google Groups "S2E Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to s2e-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/s2e-dev/ad2d7082-3d57-4289-998b-6964467e12c7n%40googlegroups.com.

Jay Ironman

unread,
Sep 16, 2023, 10:49:23 PM9/16/23
to S2E Developer Forum
Do you mean I need to start over from scratch?
Reply all
Reply to author
Forward
0 new messages