How to install python3.7 and create a virtualenv with pip on Ubuntu 18.04?

后端 未结 2 1401
一生所求
一生所求 2020-12-13 02:51

I\'m trying to set up a standard virtualenv with python 3.7 on Ubuntu 18.04, with pip (or some way to install packages in the virtualenv). The standard way to install pytho

相关标签:
2条回答
  • 2020-12-13 03:09

    I don't know if it's best practices or not, but if I also install python3-venv and python3.7-venv then everything works (this is tested on a fresh stock Debian buster docker image):

    % sudo apt install python3.7 python3-venv python3.7-venv
    % python3.7 -m venv py37-venv
    % . py37-venv/bin/activate
    (py37-venv) % 
    

    Note that it also installs all of python3.6 needlessly, so I can't exactly say I like it, but at least it does work and doesn't require running an unsigned script the way get-pip.py does.

    0 讨论(0)
  • 2020-12-13 03:13
    sudo apt install python3-venv
    python3 -m venv env
    
    0 讨论(0)
提交回复
热议问题