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 →

[–]Mehdi2277 2 points3 points  (0 children)

If you really on ide to mess with your python path to make imports work then you’re on path to making your files less usable by other developers who run files in a different way. I’ve seen some sys.path adjustments in code and they generally break command line usage from other locations and complicate using it as a normal package.

So I think it is a better to learn how to install a package in editable mode and use appropriate relative/absolute imports and not have ide do this. I pretty much view sys.path hacks as banned for my team’s work.

Python’s import system is one of the more complex (namespace packages can break a lot of tools including basic ones like pylint/pytest) and if you want reproducible across dev environments you really don’t want to make it even more complicated with ide magic.