Opened 12 years ago

Closed 11 years ago

#36178 closed request (fixed)

Add port select support for pip and virtualenv

Reported by: cdeil (Christoph Deil) Owned by: akitada@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: tehfink, petrrr
Port: pip_select virtualenv_select

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Would it be possible to implement the possibility to select a default pip and virtualenv? E.g.

sudo port select --set pip py27-pip
sudo port select --set virtualenv py27-virtualenv

Just like for python, ipython, cython or nosetests this would be very useful. pip and virtualenv are quite frequently used e.g. in shell scripts written by others to install software and if only pip-2.7 is on the PATH they fail. I would prefer setting the default version via Macports than via symlinks or aliases.

Change History (8)

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to akitada@…

comment:2 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

comment:3 Changed 12 years ago by phildobbin@…

I too would like to add my support for this feature.

I've just installed virtualenv_select under the impression it would fulfil this function but every which way I attempt to use it I get:

Selecting 'virtualenv-2.7' for 'virtualenv' failed: The specified version 'virtualenv-2.7' is not valid

comment:4 Changed 12 years ago by cdeil (Christoph Deil)

Ah, apparently a virtualenv_select port was added. Great!

The trick is to select "virtualenv27", not "virtualenv-2.7", which you can find out with "port select --list virtualenv".

The only weird thing is that Macports installs /opt/local/bin/virtualenv-2.7-2.7, is that on purpose? I've never used or needed it!?

$ ls -lh /opt/local/bin/virtualenv*                                     
lrwxr-xr-x  1 root  admin    74B Sep 19 16:51 /opt/local/bin/virtualenv-2.7 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv
lrwxr-xr-x  1 root  admin    78B Sep 19 16:51 /opt/local/bin/virtualenv-2.7-2.7 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv-2.7
lrwxr-xr-x  1 root  admin    84B Sep 12 11:13 /opt/local/bin/virtualenvwrapper.sh-2.7 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh

$ port select --list virtualenv
Available versions for virtualenv:
	none (active)
	virtualenv27

$ sudo port select virtualenv virtualenv27      
Selecting 'virtualenv27' for 'virtualenv' succeeded. 'virtualenv27' is now active.


$ ls -lh /opt/local/bin/virtualenv*                                     
lrwxr-xr-x  1 root  admin    29B Sep 20 16:12 /opt/local/bin/virtualenv -> /opt/local/bin/virtualenv-2.7
lrwxr-xr-x  1 root  admin    74B Sep 19 16:51 /opt/local/bin/virtualenv-2.7 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv
lrwxr-xr-x  1 root  admin    78B Sep 19 16:51 /opt/local/bin/virtualenv-2.7-2.7 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv-2.7
lrwxr-xr-x  1 root  admin    84B Sep 12 11:13 /opt/local/bin/virtualenvwrapper.sh-2.7 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh

comment:5 Changed 11 years ago by tehfink

Cc: djsnickles@… added

Cc Me!

comment:6 Changed 11 years ago by petrrr

Cc: Peter.Danecek@… added

Cc Me!

comment:7 Changed 11 years ago by petrrr

I'd say both select ports were implemented. So this ticket is a leftover and should be closed!

petr% port search pip_select
pip_select @0.1 (python)
    common files for selecting default pip version

petr% port search virtualenv_select
virtualenv_select @0.1 (python)
    common files for selecting default virtualenv version

comment:8 Changed 11 years ago by mf2k (Frank Schima)

Keywords: select pip virtualenv removed
Port: pip_select virtualenv_select added; py-pip py-virtualenv removed
Resolution: fixed
Status: newclosed
Version: 2.1.2

pip_select was added in r115843 - see also #38016.

virtualenv_select was added in r97885.

Note: See TracTickets for help on using tickets.