-
-
Save sajadbahar/9240217 to your computer and use it in GitHub Desktop.
CentOS 6: Install Python 2.7.6, setuptools, pip and virtualenv all you need for your new CentOS server. Run script with `sudo`.
This file contains hidden or 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 | |
| # Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/ | |
| # Install stuff # | |
| ################# | |
| # Install development tools and some misc. necessary packages | |
| yum -y groupinstall "Development tools" | |
| yum -y install zlib-devel # gen'l reqs | |
| yum -y install bzip2-devel openssl-devel ncurses-devel # gen'l reqs | |
| yum -y install mysql-devel # req'd to use MySQL with python ('mysql-python' package) | |
| yum -y install libxml2-devel libxslt-devel # req'd by python package 'lxml' | |
| yum -y install unixODBC-devel # req'd by python package 'pyodbc' | |
| yum -y install sqlite sqlite-devel # you will be sad if you don't install this before compiling python, and later need it. | |
| # Alias shasum to == sha1sum (will prevent some people's scripts from breaking) | |
| echo 'alias shasum="sha1sum"' >> $HOME/.bashrc | |
| # Install Python 2.7.6 | |
| wget --no-check-certificate http://www.python.org/ftp/python/2.7.6/Python-2.7.6rc1.tar.bz2 | |
| tar xf Python-2.7.6rc1.tar.bz2 | |
| cd Python-2.7.6rc1 | |
| ./configure --prefix=/usr/local | |
| make && make altinstall | |
| # get the setup script for Setuptools: | |
| wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | |
| # Then install it for Python 2.7: | |
| python2.7 ez_setup.py | |
| # Now install pip using the installed setuptools: | |
| easy_install-2.7 pip | |
| # Install virtualenv for Python 2.7: | |
| pip2.7 install virtualenv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment