Skip to content

Instantly share code, notes, and snippets.

@perpouh
Created February 28, 2019 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perpouh/9af2c825caddcf6236a89fbcf3bc0108 to your computer and use it in GitHub Desktop.
Save perpouh/9af2c825caddcf6236a89fbcf3bc0108 to your computer and use it in GitHub Desktop.
vagrant upでpython環境を立ち上げたい
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