-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathpython.sh
37 lines (31 loc) · 896 Bytes
/
python.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash -eux
SSH_USER=${SSH_USERNAME:-vagrant}
export HOME=/home/${SSH_USER}
echo "==> Installing pyenv build tools"
# From https://github.com/yyuu/pyenv/wiki/Common-build-problems
sudo apt-get install -y \
make \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
wget \
curl \
llvm
echo "==> Preparing pyenv configuration."
cat <<EOF >> /home/${SSH_USER}/.bashrc
export PATH="\$HOME/.pyenv/bin:\$PATH"
eval "\$(pyenv init -)"
eval "\$(pyenv virtualenv-init -)"
EOF
echo "==> Installing pyenv"
su ${SSH_USER} <<EOF
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
source ~/.bashrc
/home/${SSH_USER}/.pyenv/bin/pyenv install 3.4.3
/home/${SSH_USER}/.pyenv/bin/pyenv global 3.4.3
EOF
chown -R ${SSH_USER}:${SSH_USER} /home/${SSH_USER}
export HOME=/home/root