bash Vagrant 在配置期间没有安装 pip

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35191289/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 14:11:46  来源:igfitidea点击:

Vagrant not installing pip during provision

pythonbashvagrantvagrantfilevagrant-provision

提问by testing

Here is my bootstrap.sh:

这是我的bootstrap.sh

#!/usr/bin/env bash

apt-get update
apt-get install -y apache2
apt-get install python-pip

if ! [ -L /var/www ]; then
  rm -rf /var/www
  ln -fs /vagrant /var/www
fi

Here is my Vagrantfile:

这是我的 Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise64"
  config.vm.provision :shell, path: "bootstrap.sh"
end

I ran

我跑了

vagrant reload --provision
vagrant ssh

but when I type pipit returns

但是当我输入时pip它返回

The program 'pip' is currently not installed. You can install it by typing: sudo apt-get install python-pip

当前未安装程序“pip”。您可以通过键入来安装它: sudo apt-get install python-pip

I verified I was able to

我确认我能够

sudo apt-get install library

in the ssh terminal, so I am not sure what is wrong.

在 ssh 终端中,所以我不确定出了什么问题。

Any help would be appreciated.

任何帮助,将不胜感激。

回答by Jeewes

Try replacing apt-get install python-pipwith apt-get -y install python-pipas Chris already said in the comments.

尝试更换apt-get install python-pipapt-get -y install python-pip克里斯在评论中已经说过了。