We used to have /usr/bin/virtualenv-2 and /usr/bin/virtualenv in python2-virtualenv. /usr/bin/virtualenv-3 in python3-virtualenv.

As of https://bugzilla.redhat.com/show_bug.cgi?id=1599422 this will change on F29+. There will be just one /usr/bin/virtualenv.


If you need to specify python version of the created virtual environment, use --python/-p:

  $ virtualenv -p /usr/bin/python2.7 <venv_name>
  $ virtualenv -p python3.7 <venv_name>
  $ virtualenv -p pypy2 <venv_name>
  $ virtualenv -p /opt/tauthon/bin/tauthon2.8 <venv_name>

If you omit -p, the Python version will be 3.7 on F29+, 2.7 before that. I recommend always using the -p option explicitly to avoid surprises.


If you have Python 3.4+ (including PyPy), you can use the standard library venv module instead (I recommend that):

  $ python3.7 -m venv <venv_name>
  $ pypy3 -m venv <venv_name>

Unlike virtualenv, here the interpreter that runs the venv module is the same that will be used in the virtual environment.


If you really need to **run** virtualenv using python2, you can use -m:

  $ python2 -m virtualenv --python=python3.7 <venv_name>


If you need to BuildRequire virtualenv from your packages, you can use:

  BuildRequires: virtualenv

(once the change is done on F29+), or:

  BuildRequires: /usr/bin/virtualenv

(already now on any Fedora version)


PS virtualenv-2 and  virtualenv-3 were Fedora specific hacks.

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/message/CG3AOYHZTELQ5OUFRMLLQI3X2LSLUS7O/

Reply via email to