Only one variant of a MacPorts
port can be active at any one time. However, in MacPorts
terminology, multiple variants and/or versions of a port can be installed
simultaneously. Of those, at most one is active
, any others are inactive
. If you need to occasionally alternate between variants, you can activate a specific variant as needed. That will also automatically deactivate any conflicting active port. For example, here's a hypothetical vim
example (not fully tested!):
$ sudo port install vim +python26
$ sudo port clean vim
$ sudo port install vim +python31
$ sudo port echo installed |grep vim
vim @7.3.21_0+python26
vim @7.3.21_0+python31
$ sudo port activate vim @7.3.21_0+python26
# ... edit with Python 2
# ...
$ sudo port activate vim @7.3.21_0+python31
# ... edit with Python 3
# ...