Jul-26-2024, 10:24 PM
(This post was last modified: Jul-26-2024, 10:31 PM by Gribouillis.)
(Jul-26-2024, 05:11 PM)sunflowerdog Wrote: Yeah, I'm not sure why Python 3.11 is adding my project folder to sys.path but 3.12 isn't?I don't understand it either. It may be a Windows-specific issue but I never use the Windows OS.
It is not very satisfactory but you could add the following lines in your
sitecustomize
or your usercustomize
module to force the inclusion of the main script's directory in sys.pathfrom pathlib import Path import sys if sys.argv: sys.path.insert(0, str(Path(sys.argv[0]).resolve().parent))
« We can solve any problem by introducing an extra level of indirection »