Here is my 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:
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 pip
it returns
The program 'pip' is currently not installed. You can install it by typing: 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.
Any help would be appreciated.
A “pip: command not found” error occurs when you fail to properly install the package installer for Python (pip) needed to run Python on your computer. To fix it, you will either need to re-install Python and check the box to add Python to your PATH or install pip on your command line.
Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process. Voila!
Pip relies on package authors to stipulate the dependencies for their code in order to successfully download and install the package plus all required dependencies from the Python Package Index (PyPI). But if packages are installed one at a time, it may lead to dependency conflicts.
If you're in an active virtual environment, then the command installs pip into that environment. Otherwise, it installs pip globally on your system. The --upgrade option ensures that the pip version is the same as the one declared in ensurepip .
Try replacing apt-get install python-pip
with apt-get -y install python-pip
as Chris already said in the comments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With