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

The 'sanic_restplus.api' package was not installed in a way that PackageLoader understands #23

Closed
hsz1273327 opened this issue May 14, 2021 · 2 comments

Comments

@hsz1273327
Copy link

win10,sanic 20.12.3,sanic-restplus 0.5.6

I got the value error as below:

Traceback (most recent call last):
  File "app/__main__.py", line 12, in <module>
    main(sys.argv[1:])
  File "app/__main__.py", line 8, in main
    app(argv)
  File "C:\Users\hsz12\Documents\WORKSPACE\project_manager_with_git\tp_py_sanic_api\env\lib\site-packages\schema_entry\entrypoint.py", line 204, in __call__
    self.parse_args(parser, argv)
  File "C:\Users\hsz12\Documents\WORKSPACE\project_manager_with_git\tp_py_sanic_api\env\lib\site-packages\schema_entry\entrypoint.py", line 451, in parse_args
    self.do_main()
  File "C:\Users\hsz12\Documents\WORKSPACE\project_manager_with_git\tp_py_sanic_api\app\app.py", line 92, in do_main
    rest_assoc.api(api)
  File "C:\Users\hsz12\Documents\WORKSPACE\project_manager_with_git\tp_py_sanic_api\env\lib\site-packages\sanic_restplus\restplus.py", line 10, in api
    return plug.api(reg, *args, api_class=api_class, **kwargs)
  File "C:\Users\hsz12\Documents\WORKSPACE\project_manager_with_git\tp_py_sanic_api\env\lib\site-packages\sanic_restplus\restplus.py", line 76, in api
    api.init_api(reg, **kwargs)
  File "C:\Users\hsz12\Documents\WORKSPACE\project_manager_with_git\tp_py_sanic_api\env\lib\site-packages\sanic_restplus\api.py", line 225, in init_api
    self._init_app(app, context)
  File "C:\Users\hsz12\Documents\WORKSPACE\project_manager_with_git\tp_py_sanic_api\env\lib\site-packages\sanic_restplus\api.py", line 235, in _init_app
    render_api_fn = self._setup_jinja2_renderer()
  File "C:\Users\hsz12\Documents\WORKSPACE\project_manager_with_git\tp_py_sanic_api\env\lib\site-packages\sanic_restplus\api.py", line 282, in _setup_jinja2_renderer
    loader = PackageLoader(__name__, 'templates')
  File "C:\Users\hsz12\Documents\WORKSPACE\project_manager_with_git\tp_py_sanic_api\env\lib\site-packages\jinja2\loaders.py", line 309, in __init__
    raise ValueError(
ValueError: The 'sanic_restplus.api' package was not installed in a way that PackageLoader understands.
@luk1999
Copy link

luk1999 commented May 17, 2021

As a temporary fix you can force Jinja2==2.10.3 in you requirements file.

@hsz1273327
Copy link
Author

thanks

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