Skip to content

Instantly share code, notes, and snippets.

@ckandoth
Created November 29, 2016 22:12
Show Gist options
  • Save ckandoth/f25c7469f23e63e34bee346fcb10ec29 to your computer and use it in GitHub Desktop.
Save ckandoth/f25c7469f23e63e34bee346fcb10ec29 to your computer and use it in GitHub Desktop.
Download, install, and build Python 2.7.10 in a local folder
# Create a folder where you want to install different Pythons, and cd into it:
# Note that it doesn't need to be your home folder. Put it wherever you want to maintain such software:
export PYTHON_BASE="$HOME/python"
mkdir -p $PYTHON_BASE
cd $PYTHON_BASE
# Download source tarball into a subfolder named src, and untar:
curl --create-dirs -L -o src/Python-2.7.10.tgz https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
cd src
tar -zxf Python-2.7.10.tgz
# Configure, build, and install into a properly versioned subdirectory:
cd Python-2.7.10
./configure --prefix=$PYTHON_BASE/python-2.7.10 --enable-shared --enable-unicode=ucs4 LDFLAGS="-Wl,-rpath=$PYTHON_PREFIX/lib"
make
make install
# Make sure the latest setuptools and pip are installed:
$PYTHON_BASE/python-2.7.10/bin/python -m ensurepip
$PYTHON_BASE/python-2.7.10/bin/pip install --upgrade setuptools pip
# Install all the various packages we use here at MSKCC:
$PYTHON_BASE/python-2.7.10/bin/pip install --upgrade alabaster ansi argparse azure babel biopython drmaa filemagic fireworks fusepy ipython lockfile markerlib nose powerline-status pygments pyvcf sh snowballstemmer sphinx virtualenv wheel
$PYTHON_BASE/python-2.7.10/bin/pip install --upgrade pysam matplotlib pandas cython scipy
@amidevous
Copy link

amidevous commented Nov 14, 2023

normal not use make install for python

for python use online

make altinstall

and for pip install not use

$PYTHON_BASE/python-2.7.10/bin/python -m ensurepip

use online

$PYTHON_BASE/python-2.7.10/bin/python -m ensurepip --altinstall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment