Forums

Where is '/usr/local/lib/python3.10/' directory?

I need to change smtplib.py's source code which is under the '/usr/local/lib/python3.10/' directory. How can I access that directory or can I overwrite it?

You can't change Python core modules on PythonAnywhere. It would be an odd thing to do, though -- why do you want to change that file? There is probably a better way to achieve the same goal.

I need to change the smtplib.py under the "/usr/local/lib/python3.10/" directory. On line 875, I need to change the encoding to UTF-8. Original => msg = _fix_eols(msg).encode('ascii')

If you need to modify a library like that, your best bet is to install the module into your home directory and then edit the file there: https://help.pythonanywhere.com/pages/InstallingNewModules/

How can I exclusively install a module that is part of the Python Standard Library though?

I'm not sure about that. You might be able to subclass the class and override the method that has that code in it.