Skip to content

Instantly share code, notes, and snippets.

@jdblischak
Last active August 29, 2015 14:23
Show Gist options
  • Save jdblischak/035449e1469664810536 to your computer and use it in GitHub Desktop.
Save jdblischak/035449e1469664810536 to your computer and use it in GitHub Desktop.
Testing pysam installation with Python3
#!/bin/bash
for VERSION in 3.3.6 3.4.0 3.4.1 3.4.2 3.4.3
do
bash install-python.sh $VERSION
bash install-pysam.sh $VERSION
done
#!/bin/bash
# Install pysam for a given Python3 version.
# Requires a pre-created virtual environment in the current working directory
# named ve#.#.#
# Input is version number, e.g. 3.4.3
# usage: bash install-pysam.sh #.#.#
VERSION=$1
echo "Installing pysam for Python$VERSION"
source ve$VERSION/bin/activate
pip install pysam
python -c "import pysam"
deactivate
#!/bin/bash
# Install Python3 from source and creates a virtual environment.
# Input is version number, e.g. 3.4.3
# usage: bash install-python.sh #.#.#
VERSION=$1
echo "Installing Python$VERSION"
wget https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz --no-check-certificate
tar xzf Python-$VERSION.tgz
cd Python-$VERSION
./configure --prefix=`pwd`
make
make test
make install
cd ..
virtualenv -p Python-$VERSION/bin/python3 ve$VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment