How to deactivate all python ports I just started using enthought's canopy to manage my python packages; thus I want to disable and/or uninstall all of my macports python packages.  Nominally, I'd like to deactivate them first - make sure things still work - then uninstall and delete them.

I've tried doing:

sudo port deactivate py-*


but that returns the error:

Error: port deactivate failed: Image error: port py-abjad is not active.


I've tried to uninstall all inactive ports (sudo port uninstall inactive), but that didn't seem to resolve the issue.

Finally, if I try

sudo port deactivate active py-*


that just starts to deactivate everything...



edit:  e.g.

sudo port deactivate active py-*
---&gt;  Deactivating py27-pygtk @2.24.0_1+x11
---&gt;  Cleaning py27-pygtk
---&gt;  Deactivating libglade2 @2.6.4_7
---&gt;  Cleaning libglade2
---&gt;  Deactivating gtk2 @2.24.22_0+x11
---&gt;  Cleaning gtk2
---&gt;  Deactivating atk @2.10.0_0
---&gt;  Cleaning atk
---&gt;  Deactivating autoconf @2.69_2
---&gt;  Cleaning autoconf
---&gt;  Deactivating automake @1.14_0
---&gt;  Cleaning automake
---&gt;  Deactivating bash @4.2.45_2
---&gt;  Cleaning bash
sudo port deactivate py-* and active should do what you want. Note that py-* packages in MacPorts are usually just placeholders for the versioned ports, e.g. py27-*, so you might want to deactivate those, too.