Forums

Need Permission To Edit ConfigParser.py

I am having a problem related to a bug. Here is the stackoverflow thread https://stackoverflow.com/questions/52655708/configparser-py-keyerror-python-flask/52655880?noredirect=1#comment92244478_52655880

however without sudo being allowed I have no way to edit this file, permission denied

Please help

I'm not sure that the problem is the one the person who answered on Stack Overflow thinks it is -- you're using Python 3.7, which has its own configparser built in, while they're talking about an older version of configparser which would be installed as a separate package for versions of Python older than 2.7.

If you're having a problem loading a config file that works locally, my guess is that you're not loading the file that you think you are. What path are you using to access it? If it's a relative path (for example config.cfg or something/config.cfg) then it will be accessed relative to the working directory of your code, which might be different on PythonAnywhere to what it is on your local machine. Try using an absolute path, like /home/jguidac/something/config.cfg.