我如何使python3 -m venv在环境中安装新版本的pip?

时间:2019-09-27 02:23:55

标签: python python-3.x virtualenv python-venv

我试图理解为什么这两个命令在MacOS中产生不同的结果:

leme:Temp ar$ virtualenv env1
Using base prefix '/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7'
New python executable in /Users/ar/Temp/env1/bin/python3.7
Also creating executable in /Users/ar/Temp/env1/bin/python
Installing setuptools, pip, wheel...
done.
leme:Temp ar$ source env1/bin/activate
(env1) leme:Temp ar$ pip install pygments
Collecting pygments
  Using cached https://files.pythonhosted.org/packages/5c/73/1dfa428150e3ccb0fa3e68db406e5be48698f2a979ccbcec795f28f44048/Pygments-2.4.2-py2.py3-none-any.whl
Installing collected packages: pygments
Successfully installed pygments-2.4.2
(env1) leme:Temp ar$ deactivate

在第二种情况下,如果我将其用作模块,则会发出有关使用pip版本19.0.3的警告!我的系统中没有安装此旧版本:

leme:Temp ar$ python3 -m venv env2
leme:Temp ar$ source env2/bin/activate
(env2) leme:Temp ar$ pip install pygments
Collecting pygments
  Using cached https://files.pythonhosted.org/packages/5c/73/1dfa428150e3ccb0fa3e68db406e5be48698f2a979ccbcec795f28f44048/Pygments-2.4.2-py2.py3-none-any.whl
Installing collected packages: pygments
Successfully installed pygments-2.4.2
You are using pip version 19.0.3, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(env2) leme:Temp ar$ deactivate

有什么主意吗?很奇怪!

0 个答案:

没有答案