mkvirtualenv -p /usr/bin/python3 django
OSError: Command /root/.virtualenvs/django/bin/python3 - setuptools pkg_resources pip wheel failed with error code 2
root@6179749b5c4f:~/.virtualenvs# OSError: Command /root/.virtualenvs/django/bin/python3 - setuptools pkg_resources pip wheel failed with error code 2^C
解决方法:
查pip3版本:
pip3 --version
显示pip 8.1.1
升级pip
pip3 install --upgrade pip
Successfully installed pip-19.2.3
root@6179749b5c4f:~/.virtualenvs# mkvirtualenv -p /usr/bin/python3 django
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /root/.virtualenvs/django/bin/python3
Also creating executable in /root/.virtualenvs/django/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
(django) root@6179749b5c4f:~/.virtualenvs#
成功安装并进入虚拟环境(django)