Why is setup.py installing old files?

If you don't install with pip, you can't uninstall with pip, so you never actually uninstalled the old version. python setup.py install will install different versions, but typically they install on top of the old versions (except for the .egg-info file or directory). You don't say how exactly the two versions were living side-by-side, because setup.py (or pip) won't rename site-packages/my_module to my_module_v1, for example. I assume that you changed the directory structure and .py file names enough that the two versions could coexist in the same parent directory, so in IPython you could run from my_module import OldClassName and from my_module import NewClassName.


You can try installing using pip from the setup.py file using pip install -e . in the directory . This installs the package in editable mode. It installs any change you make to the code.