1

I am running a script and it runs perfectly and produces the output. However, if I try to debug it in Pycharm, it produces a KeyError when trying to load the six module. This module is being called by a package that I am using. I am not familiar with it. Any ideas on what is causing the import error?

# File #1: 
    import six  # this call to import works
    from six.moves.urllib_parse import urljoin   # line that fails

# File #2 that it calls
    def load_module(self, fullname):
        try:
            # in case of a reload
            return sys.modules[fullname]
Chris McL
  • 190
  • 10
  • what error are you getting? – Epsi95 Aug 20 '21 at 03:42
  • https://stackoverflow.com/questions/52295117/basemap-import-error-in-pycharm-keyerror-proj-lib looks like a similar issue – Brian Aug 20 '21 at 03:43
  • Epsi95, the error I get is simply "Python BaseException". The next line is the code is ``` except KeyError: pass``` But it doesn't seem to ever get there. If I try to resume the program, it just keeps raising these exceptions. Brian - I'm not seeing the connection. – Chris McL Aug 20 '21 at 04:55

1 Answers1

1

I toggled the selections in the Run > View Breakpoints menu. Once that was done, the debug worked properly.

This error happened immediately after a Pycharm upgrade. I suspect that there may be some corruption that resulted. Either that or the 100th time of running the same code produced a different result. :-)

Chris McL
  • 190
  • 10