You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when trying to start the insecure application with python3 app_insecure.py I'm stuck with the follwoing error:
Traceback (most recent call last):
File "/home/marius/projects/fopnp/py3/chapter11/app_insecure.py", line 12, in <module>
get = Environment(loader=PackageLoader(__name__, 'templates')).get_template
File "/home/marius/.local/lib/python3.9/site-packages/jinja2/loaders.py", line 286, in __init__
spec = importlib.util.find_spec(package_name)
File "/usr/lib64/python3.9/importlib/util.py", line 114, in find_spec
raise ValueError('{}.__spec__ is None'.format(name))
ValueError: __main__.__spec__ is None
which seems to come from this line
get = Environment(loader=PackageLoader(__name__, 'templates')).get_template
Running the app_improved.py works without any issues.
Python Version: 3.9.1
Flask Version: 2.0.1
When I downgraded to flask 1.1.4 app_insecure.py works as expected.
Hope this issue can be a reference for anyone else coming accross this problem.
I'm also curious if there will be updated version for flask > 2.0.0.
The text was updated successfully, but these errors were encountered:
Thanks for opening an issue to alert other users to the problem, and suggesting the quick fix of downgrading Flask. It’s been several years since I’ve kept up with the Flask project, so I’m not sure what’s changed that broke the old way of creating an Environment. If I get extra time within the next few months, I might look into the issue, or maybe another user will dive in and offer a fix before I can get around to it.
Hey,
when trying to start the insecure application with
python3 app_insecure.py
I'm stuck with the follwoing error:which seems to come from this line
Running the app_improved.py works without any issues.
Python Version: 3.9.1
Flask Version: 2.0.1
When I downgraded to flask 1.1.4 app_insecure.py works as expected.
Hope this issue can be a reference for anyone else coming accross this problem.
I'm also curious if there will be updated version for flask > 2.0.0.
The text was updated successfully, but these errors were encountered: