Forums

Python errors out of nowhere :(

Hello. my sites have been down and im trying to figure out why. Ive seen a couple post about recreating the virtualenvs. Im trying to follow: https://help.pythonanywhere.com/pages/RebuildingVirtualenvs/

But when trying to create the requirements.txt im getting:

pip3 freeze > /tmp/requirements.txt Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: Py_Initialize: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings'

Any idea on how i can fix this?

You can't run pip freeze after your system image was changed as it is no longer working. You need to recreate your venv by hand by installing packages required by your app.

Thanks fjl, worked for me!

Glad to hear that!