Discord bot keep_alive and MarkupSafe

Okay, so I host a Discord bot on Replit and I use the keep_alive python package to keep it 24/7.

And I have this error now which I have never seen:

  File "main.py", line 2310, in <module>
    import keep_alive
  File "/home/runner/Dizzy-bbb-1/keep_alive.py", line 3, in <module>
    from flask import Flask
  File "/home/runner/Dizzy-bbb-1/venv/lib/python3.8/site-packages/flask/__init__.py", line 14, in <module>
    from jinja2 import escape
  File "/home/runner/Dizzy-bbb-1/venv/lib/python3.8/site-packages/jinja2/__init__.py", line 6, in <module>
    from markupsafe import escape
ImportError: cannot import name 'escape' from 'markupsafe' (unknown location)```

I tried lots of ways to fix it, but they didn't work. Can someone help?

try after running in Shell

pip install --reinstall markupsafe
2 Likes

Now I got this:

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

An error occurred during configuration: option use-feature: invalid choice: 'content-addressable-pool' (choose from 'fast-deps', 'truststore', 'no-binary-enable-wheel-cache')