I know there are multiple solutions online, but some are for windows, some are environmental variable, etc..
What is the best way?
Find your site-packages directory and create a new file called myproj.pth
Inside that file, put each directory you want to add, one per line like so:
/home/myuser/svn-repos/myproject /home/myuser/svn-repos/SomeOtherProject
Python loads *.pth every time it runs, and imports all paths in each of those files.
In Ubuntu, that directory can often be found at
/usr/local/lib/python2.6/dist-packages/
~/.bashrc you won't have such an issueI personally just define PYTHONPATH in ~/.bashrc, as for what's the "best" approach? I think that's hard to answer (or rather, there's no correct answer). It depends.
PYTHONPATH so we can vote that up.PYTHONPATH, so just mentioning it alone doesn't add any value.