我的pip版本被关闭了--每个pip命令都在说:
You are using pip version 6.0.8, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
我不喜欢这里给出的答案:How can I get rid of this warning to upgrade from pip?,因为他们都想让pip
与RH版本脱节。
因此,我尝试用这个VagrantFile安装一个干净的系统:
Vagrant.configure("2") do |config|
config.ssh.username = 'root'
config.ssh.password = 'vagrant'
config.ssh.insert_key = 'true'
config.vm.box = "bento/centos-7.3"
config.vm.provider "virtualbox" do |vb|
vb.cpus = "4"
vb.memory = "2048"
end
config.vm.synced_folder "..", "/vagrant"
config.vm.network "public_network", bridge: "eth0", ip: "192.168.1.31"
config.vm.provision "shell", inline: <<-SHELL
set -x
# Install pip
yum install -y epel-release
yum install -y python-pip
pip freeze # See if pip prints version warning on fresh OS install.
SHELL
end
但后来我得到了:
==> default: ++ pip freeze
==> default: You are using pip version 8.1.2, however version 9.0.1 is available.
==> default: You should consider upgrading via the 'pip install --upgrade pip' command.
因此,我似乎使用了错误的命令来安装pip
。什么是正确的命令使用?
发布于 2017-09-18 22:17:19
有许多选项(2021年更新).
使用命令行标志
pip <command> --disable-pip-version-check [options]
从命令行配置pip
pip config set global.disable-pip-version-check true
设置环境变量
export PIP_DISABLE_PIP_VERSION_CHECK=1
使用配置文件
创建一个pip配置文件并将disable-pip-version-check
设置为true
[global]
disable-pip-version-check = True
在许多linux上,pip配置文件的默认位置是$HOME/.config/pip/pip.conf
。Windows、macOS和virtualenvs的位置非常不同,无法在这里详细说明。请参阅文档:
发布于 2018-09-27 17:45:47
或者只使用命令行标志。
pip --disable-pip-version-check [normal stuff here]
发布于 2019-01-14 09:48:56
另一种不太具有侵扰性且不直接记录但完全支持的禁用版本检查的方法是定义:
export PIP_DISABLE_PIP_VERSION_CHECK=1
https://stackoverflow.com/questions/46288847
复制相似问题