virtualenvwrapper and Python 3

后端 未结 9 1984
执念已碎
执念已碎 2020-12-22 17:06

I installed python 3.3.1 on ubuntu lucid and successfully created a virtualenv as below

virtualenv envpy331 --python=/usr/local/bin/python3.3
相关标签:
9条回答
  • 2020-12-22 18:02

    This post on the bitbucket issue tracker of virtualenvwrapper may be of interest. It is mentioned there that most of virtualenvwrapper's functions work with the venv virtual environments in Python 3.3.

    0 讨论(0)
  • 2020-12-22 18:03

    You can make virtualenvwrapper use a custom Python binary instead of the one virtualenvwrapper is run with. To do that you need to use VIRTUALENV_PYTHON variable which is utilized by virtualenv:

    $ export VIRTUALENV_PYTHON=/usr/bin/python3
    $ mkvirtualenv -a myproject myenv
    Running virtualenv with interpreter /usr/bin/python3
    New python executable in myenv/bin/python3
    Also creating executable in myenv/bin/python
    (myenv)$ python
    Python 3.2.3 (default, Oct 19 2012, 19:53:16) 
    [GCC 4.7.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    0 讨论(0)
  • 2020-12-22 18:06

    virtualenvwrapper now lets you specify the python executable without the path.

    So (on OSX at least)mkvirtualenv --python=python3 nameOfEnvironment will suffice.

    0 讨论(0)
提交回复
热议问题