When I run a container, get error with python

Viewed 22

I'm using Python 3.10 with Flask and Poetry for developing APIs, but when I gonna run a container, I get an error that I was able to understand:

File "/usr/local/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/lib/python3.8/runpy.py", line 144, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/local/lib/python3.8/runpy.py", line 111, in _get_module_details
__import__(pkg_name)
File "/app/app/__init__.py", line 3, in <module>
from flask import Flask
File "/usr/local/lib/python3.8/site-packages/flask/__init__.py", line 14, in <module>
from jinja2 import escape
File "/usr/local/lib/python3.8/site-packages/jinja2/__init__.py", line 12, in <module>
from .environment import Environment
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 25, in <module>
from .defaults import BLOCK_END_STRING
File "/usr/local/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in <module>
from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
File "/usr/local/lib/python3.8/site-packages/jinja2/filters.py", line 13, in <module>
from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.8/site-packages/markupsafe/__init__.py)

I'm not sure if the problem is Python 3.8 in the route File (I'm using Python 3.10).

So, I tried to solve the problem with poetry install, getting this:

** Installing dependencies from lock file ** 

No dependencies to install or update 

By the way, I'm using PyCharm IDE. Please, help me to solve this, I have no idea what is going on.

0 Answers
Related