Created
February 28, 2019 08:18
-
-
Save perpouh/9af2c825caddcf6236a89fbcf3bc0108 to your computer and use it in GitHub Desktop.
vagrant upでpython環境を立ち上げたい
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.box = "centos/7" | |
config.vm.box_download_insecure = true | |
config.vm.synced_folder ".", "/vagrant", disabled: true | |
config.vm.provision "shell", inline: <<-SHELL | |
if [ ! -e '/usr/bin/git' ]; then | |
yum install -y git | |
fi | |
if !(type "pyenv" > /dev/null 2>&1); then | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv && \ | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile && \ | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile && \ | |
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile && \ | |
source ~/.bash_profile && \ | |
pyenv -v | |
fi | |
sudo yum install -y zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel gcc libffi-devel && \ | |
pyenv install 3.6.5 && \ | |
pyenv global 3.6.5 | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment