0

I am having some trouble with a library and debugging it. Basically I switched from one version to a forked version, which worked fine locally, but once deployed to the production server didn't work.

I then went into the file I thought was being loaded to see what was going on, and put some print()'s, but after restarting apache2 and running my script, none of the prints are showing. I get the feeling it isn't loading the file I have modified, and so want to confirm where it is making the request from.

sys.path isn't tremendously helpful, and in the venv directory I have a ----.dist-info folder for my library, but not the actual src for me to tweak, that has (for some reason) been put elsewhere (I checked this using pip3 list).

Any help or suggestions would be appreciated, as not sure how I can debug things with the information I have at present.

esqew
  • 42,425
  • 27
  • 92
  • 132
retrodans
  • 123
  • 1
  • 1
  • 9
  • Check out `sys.modules`. It's a dict so you can do `sys.modules["mymodule"]`. And it will show you the module's path. Another good thing to know is the `dir` function, which will print out all members of an object. E.g. `dir(sys)` – RecencyEffect May 23 '21 at 20:39
  • For starters you can check `module.__file__` (also try deleting `__pycache__`). If that doesn't help, you can dig into the import machinery to get more information. – a_guest May 23 '21 at 21:41

0 Answers0