Skip to content

Instantly share code, notes, and snippets.

@ChihChengLiang
Forked from shiraco/python2_startup.sh
Created December 20, 2015 17:17
Show Gist options
  • Save ChihChengLiang/e76c93fa0a697b4e4efa to your computer and use it in GitHub Desktop.
Save ChihChengLiang/e76c93fa0a697b4e4efa to your computer and use it in GitHub Desktop.
EC2 Ubuntu python startup
#!/bin/bash
# update the local repo listing
sudo apt-get update -y
sudo apt-get upgrade -y
# install language-pack-ja
sudo apt-get -y install language-pack-ja
# install git
sudo apt-get -y install git
# install pyenv
git clone https://github.com/yyuu/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
# python install
sudo apt-get -y install gcc \
build-essential \
zlib1g-dev \
libbz2-dev \
libssl-dev \
libreadline-dev \
libsqlite3-dev
pyenv install -l
pyenv install 2.7.9
pyenv global 2.7.9
pip install virtualenv
pyenv rehash
# make the development dirs
mkdir -p ~/workspace/python/scrapy
cd ~/workspace/python/scrapy
# create and start a virtual environment
virtualenv venv --distribute --no-site-packages
. venv/bin/activate
# install scrapy
sudo apt-get install libffi-dev \
libxml2-dev \
libxslt-dev
pip install scrapy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment