python - 如何让`python3 -m venv`在环境中安装新版本的pip?
问题描述
我试图理解为什么这两个命令会在我的 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
任何想法?很奇怪!
解决方案
推荐阅读
- java - Microsoft 图:使用 Put 请求 Java 更新文档
- php - 使用相同的 id Laravel 再次存储数据
- pandas - 将日期操作代码转换为函数,然后将其应用于多列
- reactjs - 在“加载”时反应可加载(延迟加载)?
- c# - 使用 OLEDB 提供程序连接到 Access 数据库崩溃(自 Office 365 Build 12430.20184 起)
- python - keep_prob: 0.8 是什么意思?
- curl - 通过 curl 向 API 发送音频数据
- python - 如果答案是随机的,我如何追踪对原始答案的响应?
- google-cloud-platform - 在 GKE 中使用 N2 机器类型 - (Google Kubernetes Engine)
- c - 我尝试在 C 中为链表编写代码