Last active
December 20, 2015 17:17
-
-
Save shiraco/286d20f6a824fe7f535a to your computer and use it in GitHub Desktop.
EC2 Ubuntu python startup
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
#!/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