Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

ModuleNotFoundError: No module named 'jinja2' #5431

Closed
Lrizika opened this issue Jun 11, 2019 · 4 comments
Closed

ModuleNotFoundError: No module named 'jinja2' #5431

Lrizika opened this issue Jun 11, 2019 · 4 comments
Labels
z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@Lrizika
Copy link
Contributor

Lrizika commented Jun 11, 2019

As of #5377, jinja2 is an unconditional import in /rest/client/v2_alpha/account.py, but is still listed under CONDITIONAL_REQUIREMENTS in /python_dependencies.py

As a result, after upgrading with pip3 to 1.0.0, there's a ModuleNotFoundError (presumably, the same would occur on a new install):

~/synapse$ synctl start
Starting ...
Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.6/site-packages/synapse/app/homeserver.py", line 64, in <module>
    from synapse.rest import ClientRestResource
  File "/usr/local/lib/python3.6/site-packages/synapse/rest/__init__.py", line 32, in <module>
    from synapse.rest.client.v2_alpha import (
  File "/usr/local/lib/python3.6/site-packages/synapse/rest/client/v2_alpha/account.py", line 21, in <module>
    import jinja2
ModuleNotFoundError: No module named 'jinja2'
error starting (exit code: 1); see above for logs

Workaround:

Install jinja2 (pip3 install jinja2).

@927589452
Copy link

can confirm the bug for fresh installations

@richvdh
Copy link
Member

richvdh commented Jun 12, 2019

this should be a quickish fix and is a regression in 1.0

@menturion
Copy link

I can also confirm this bug for a fresh installation. Please fix this ASAP.

anoadragon453 added a commit that referenced this issue Jun 21, 2019
Fixes #5431

`jinja2` was being imported even when it wasn't strictly necessary. This made it required to run Synapse, even if the functionality that required it wasn't enabled. This was causing new Synapse installations to crash on startup.

Email modules are now required.
@anoadragon453
Copy link
Member

Fixed in #5514. Thanks for reporting.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-bug (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

6 participants