views:

63

answers:

4

Hi 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?

Thanks in advance

+1  A: 

There is no uninstallation feature in distutils. This has been discussed here and might be of some help. http://stackoverflow.com/questions/1550226/python-setup-py-uninstall

python setup.py develop --record files.txt

Delete files with

cat files.txt | xargs rm -rf
pyfunc
Actually --record didn't work for me with develop mode. But it works fine in install mode
Vasudev
+1  A: 

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.

Tanerax
Well from next time I play with packages I will use this so I won't screw up my system Python. Thanks for the info
Vasudev
+2  A: 

Edit easy-install.pth in your site-packages directory and remove the line that points to your development version of that package.

Zooko
Yeah i did exactly this and one more file was there by name package-egg-link or something which I removed and now reference to the module is removed Thanks :)
Vasudev
+2  A: 

Use the --uninstall or -u option to develop, i.e:

python setup.py develop --uninstall

This will remove it from easy-intall.pth and delete the .egg-link. The only thing it doesn't do is delete scripts (yet).

pjeby