Jinja2 error during make

Hi Team,

since yesterday I am trying to install mediagoblin 0.12 on Ubuntu 20.04. Following the deployment documentation I get to the point where I run the make command and finishes with

Installed /srv/mediagoblin.local/mediagoblin/lib/python3.8/site-packages/Pygments-2.13.0-py3.8.egg
error: Jinja2 2.10.1 is installed but Jinja2>=3.0 is required by {'sphinx'}
make: *** [Makefile:124: bin/python] Error 1

if I run pip install jinja2 -U and upgrade jinja2 to 3.1 rerunning the command gives no errors and it seems to finishes will the end.

This creates another problem - running gmg dbupdate then says:

mediagoblin@mediagoblinserver:/srv/mediagoblin.local/mediagoblin$ ./bin/gmg dbupdate
Traceback (most recent call last):
  File "/srv/mediagoblin.local/mediagoblin/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_master
  File "/srv/mediagoblin.local/mediagoblin/lib/python3.8/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/srv/mediagoblin.local/mediagoblin/lib/python3.8/site-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (Jinja2 3.1.2 (/var/lib/mediagoblin/.local/lib/python3.8/site-packages), Requirement.parse('jinja2<3.0.0'), {'mediagoblin'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./bin/gmg", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/srv/mediagoblin.local/mediagoblin/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3252, in <module>
    def _initialize_master_working_set():
  File "/srv/mediagoblin.local/mediagoblin/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
  File "/srv/mediagoblin.local/mediagoblin/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/srv/mediagoblin.local/mediagoblin/lib/python3.8/site-packages/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/srv/mediagoblin.local/mediagoblin/lib/python3.8/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/srv/mediagoblin.local/mediagoblin/lib/python3.8/site-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (Jinja2 2.10.1 (/usr/lib/python3/dist-packages), Requirement.parse('Jinja2>=3.0'), {'sphinx'})

How am I able to fix this situation in order to continue with the setup?

Thanks in advance!


Assigned to
1 year, 6 months ago
1 year, 2 months ago
No labels applied.

~iptrip 1 year, 5 months ago*

Hello! I am facing the same issue (on Debian 11). I think the issue can be solved by using virtualenv, but I haven't figured it out for myself yet. I'm hoping someone who's familiar with the project will help. Thank you!

Edit: I see now that some changes were made to the master branch that haven't made it into the stable branch yet and that the "sweet spot" for Jinja2 dependency is > 3.0 and <3.1

~shtrom 1 year, 5 months ago

I don't have a full solution, but I worked on fixing all the depndencies so 1. they don't break the install and 2. the testsuite passes.

My latest list is at https://git.sr.ht/~shtrom/mediagoblin/tree/refactor-configure/item/setup.cfg#L60, so you might be able to copy/paste the contstaints to get a working set.

I have purposefully tried to not alter the code itself, so those versions should work with 0.12, but there are a number of deprecation warnings that we'll have to fix in the code at some point (AFAIC, I want to finish the build refactor in isolation before updating the code).

~komali2 1 year, 2 months ago

I also had this issue on Ubuntu 22.04, both with and without a python virtual environment activated.

Trying the master branch removed the issue on make, as well as a similar error regarding jinja versions when I tried to do ./bin/gmg dbupdate . However, Now I'm getting this error: pkg_resources.DistributionNotFound: The 'idna<3,>=2.5' distribution was not found and is required by requests. I will update if I get a solution.

~sturm REPORTED FIXED 1 year, 2 months ago

Hi ~blagovest, ~iptrip, I've just pushed up some changes to the master branch that installs a recent Pip and uses pip install rather than python setup.py develop to install dependencies. I suspect this, in combination with the pinned maximum version on Jinja2, should now fix your issues. Apologies for the slow response. Please re-open this if you're still experiencing issues.

~komali2, unfortunately we have some version of dependencies that don't yet work on Python 3.10 (which Ubuntu 22.04 runs). The main culprit is Celery I believe. For now I've specified a maximum Python version to help avoid confusion. Fixing this situation iscertainly on my mind though. Feel free to open a separate ticket to help us track it.

~komali2 1 year, 2 months ago

~sturm, thanks, I will try the new changes you pushed, and also try using a different python version, I vaguely remember how to do that, or in any case google will know. Thanks for your hard work and for letting us know!

Register here or Log in to comment, or comment via email.