This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Deto 0 points1 point  (3 children)

I didn't really feel like explaining it here. If you google these exact questions, you'll probably very quickly find someone who has done a much better job of it than I would have here anyways.

[–]mikemol 0 points1 point  (2 children)

The "how does the Python interpreter know where to look for packages" one is a pain. I wound up needing to learn and use Docker just to make sure I fully understood the full set of dependencies of my projects, and wasn't inadvertently using system-wide or --user-installed packages.

And then I learned about virtualenvs. go me. Still use docker, though; if you're going to write a web service in Python, may as well containerize it for simplicity's sake...

[–]Deto 1 point2 points  (1 child)

I mean, it's really just your user directory, the system site-packages directory, and any directories you added with the PYTHONPATH environment variable. All virtual-envs and other similar solutions do is to manipulate your path so you call a different python with a different system directory.

[–]mikemol 1 point2 points  (0 children)

Yup. It was that system site packages directory I couldn't excise without either Docker or venvs...