I was trying the python packaging using setuptools and to test I installed the module in develop mode. i.e
python setup.py develop
This has added my modules directory to sys.path. Now I want to remove the module. Is there any way to do this?
Use the --uninstall or -u option to develop, i.e:
python setup.py develop --uninstall
This will remove it from easy-install.pth and delete the .egg-link. The only thing it doesn't do is delete scripts (yet).
setup.py, you should manually remove them.--user option as I did during the installation: python setup.py develop --uninstall --userrm or del depending on your OS. What I meant is that if you had some executables at the time you installed and then change their names (or remove them) in your setup.py, then setup.py will not know about them any longer (no matter your pip / python version and you need to take care of them manually. They are usually located in some bin directory on POSIX (read Linuxes, BSDs, MacOS X) systems, can't remember about Win.Edit easy-install.pth in your site-packages directory and remove the line that points to your development version of that package.
develop --uninstall failed because I had split a project into two, and the wrong one remained in the original directory.I have had a similar problem to this before. What I did was I loaded up the Python shell, imported the module and then printed its __file__ attribute. From there I would just remove the folder or file that was being associated.
What you may want to look into is using virtualenv this system allows you to create a instance of python separate from your system. Any modules you install or use in this instance are self contained including the version of the module.
I keep all my projects now inside of there own contained virtualenv, which allows me to install and use whatever modules I want without worrying about screwing up modules from other projects.
pipor other manager with uninstall ability for managing python packages.python setup.py developwithpip?--editable(or-e) argument that behaves roughly equivalently to setuptools'develop. I thought that perhaps--editablewas newer than your comment, but nope - a quick search of the pip repo on GitHub turns up references to editables in commits back in 2009. What's more, I see that this was already pointed out by Tomasz Wysocki before you commented!