我的ubuntu上有很多版本的python。我已经使用别名将python命令的默认版本设置为3.7。我已经使用virtualenvwrapper创建了一个虚拟环境,并希望在该虚拟环境上安装django。如果我键入python命令,激活此虚拟后,将运行3.7版。但是,如果我输入“ pip install Django”,则会安装与python 2.7相关的旧版本1.13。
我尝试使用'pip install Django == 2.2.6',但没有成功。它说:
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
如何强制pip安装与python 3.7相关的版本?
您可以尝试以下方法:
pip install django==type django version here which you want to insatll