

In Python, you're expected to make good organizational and design choices to work with the system, not constantly fight against it. Often, the "one directory" is the project's top level folder, but if you find a src folder is needed for your project for some reason, then you still only need to include a single directory on PYTHONPATH. Is there a reason that folder isn't a package (as in doesn't have an _init_.py)? The typical Python project structure is to have code inside one directory and all subdirectories with more code are packages. That's embedded Python and is something completely different.īy importing a sub-folder referencing a Class into my main.py file and came across this article for a solution, adjusting PYTHONPATH.
Run python code in vscode using german keyboard layout install#
That is almost always a good trade for a developer, especially in a professional context.Īnd a lot of programs don't bother telling you they need python to run they just install their own copy in their directory. It lets (or makes) you manage your dependencies in an organized, predictable fashion so you don't waste your time.Īnd that's why I use it: I'd rather waste a little bit of disk space than my time. As a concrete example, Flask behaves differently if you install the third party simplejson package. Not only does that keep them from conflicting with each other it also prevents you from dealing with weird bugs arising from some package you installed that has an effect you didn't anticipate. Most of the files you're seeing are probably third party, but that is kind of the entire point: allowing each project to have its dependencies isolated. (This is part of why you can't just copy the entire venv across machines reliably.) Try creating a fresh, empty one yourself and looking inside it. It's an executable, a few scripts, and any third party packages you installed the standard library files are not duplicated.
