Cannot debug Python after moving main.py

Debugging broke after moving main.py.

I’m new to Python so maybe this is a simple mistake. I attempted to organize my source code into modules as shown in the attached screenshot.

After changing the hidden .replit file, I could get the app running from the new location, but debugging is still broken. It warns me that frozen modules are being used. I’m not sure where I would pass the -Xfrozen_modules=off flag, or even if that is what I should be doing.

Hey @goldenjoe!

Try poetry remove assistant (since that package shouldn’t be there), and then add disableGuessImports = true to the top of your .replit file.

2 Likes

Thanks for the suggestion, Fire.

Maybe I’m misunderstanding your instruction regarding assistant? Here’s the pyproject and new debugger output.

Seems like the rest of that is just info/warnings? Not sure if I can help much here, as all the config looks fine…

Actually wait, isn’t config a local folder for you? Try removing the packages you don’t need/recognize, as multiple seem bugged.

2 Likes

…wait, that’s a good catch. I didn’t add those libraries. I didn’t even notice it until you just said that. Wonder how that happened. Clearing them and a quick addition to the top of main.py got me back on track. Thanks very much for the help.

import sys
import os
current_dir = os.path.dirname(os.path.abspath(__file__))
parent_dir = os.path.dirname(current_dir)
sys.path.append(parent_dir)

That would be the package auto-guesser that I had you disable two posts up, when I saw the first incorrect package.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.