Skip to content

ModuleNotFoundError: No module named 'jinja2' when importing graphql_server.aiohttp #86

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

Closed
lycantropos opened this issue Jan 25, 2022 · 1 comment · Fixed by #99
Closed

Comments

@lycantropos
Copy link

lycantropos commented Jan 25, 2022

After installation

pip install graphql-server[aiohttp]

with output

...
Successfully installed graphql-core-3.2.0 graphql-server-3.0.0b5 typing-extensions-4.0.1

then attempt to import

from graphql_server.aiohttp import GraphQLView

gives

Traceback (most recent call last):
  File ".../main.py", line 9, in <module>
    from graphql_server.aiohttp import GraphQLView
  File ".../venv/lib/python3.9/site-packages/graphql_server/aiohttp/__init__.py", line 1, in <module>
    from .graphqlview import GraphQLView
  File ".../venv/lib/python3.9/site-packages/graphql_server/aiohttp/graphqlview.py", line 19, in <module>
    from graphql_server.render_graphiql import (
  File ".../venv/lib/python3.9/site-packages/graphql_server/render_graphiql.py", line 7, in <module>
    from jinja2 import Environment
ModuleNotFoundError: No module named 'jinja2'

so it looks like it needs to be included in install_aiohttp_requires?

@theodesp
Copy link

@lycantropos I think this does not happen only to aiohttp but all of the packages that use GraphQLView:

❯ pip install graphql-server[sanic]
>>> from graphql_server.sanic import GraphQLView
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/theo.despoudis/Workspace/graphene/.venv/lib/python3.9/site-packages/graphql_server/sanic/__init__.py", line 1, in <module>
    from .graphqlview import GraphQLView
  File "/Users/theo.despoudis/Workspace/graphene/.venv/lib/python3.9/site-packages/graphql_server/sanic/graphqlview.py", line 21, in <module>
    from graphql_server.render_graphiql import (
  File "/Users/theo.despoudis/Workspace/graphene/.venv/lib/python3.9/site-packages/graphql_server/render_graphiql.py", line 7, in <module>
    from jinja2 import Environment
ModuleNotFoundError: No module named 'jinja2'

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

Successfully merging a pull request may close this issue.

2 participants