I wrote a small module that has this structure:
~/
a/
b/
foo/
__init__.py
foo.py
bar.py
Each time I use my module - I have to go in its folder and start my interactive session:
$ cd ~/a/b
$ ipython
In [0]: from foo import *
I would like to easily make available my module globally on my PC. Do I need to structure it as package with a setup.py
and execute python setup.py install
after each change on my module?
Another solution that I don't really like is adding the following to my ipython
profile:
import sys
sys.path.append("~/a/b")
Or modifying my PYTHONPATH
:
export PYTHONPATH=$PYTHONPATH:$HOME/a/b