Deeptools Installation Error


I’m a new user and I was trying to download the package ‘deeptools’ on Terminal using the command “pip3 install --user deeptools” and was running into an error with pysam. This is what keeps coming up “ERROR: Failed building wheel for pysam”, followed by “Running install for pysam … error.”

Hi there,

I answered this in your ticket but I think it’s worth describing here as well incase anyone else is facing this issue.

It looks like pysam is trying to build its own copy of htslib but failing.

    checking for bzlib.h... no
    checking for BZ2_bzBuffToBuffCompress in -lbz2... yes
    configure: error: libbzip2 development files not found

    The CRAM format may use bzip2 compression, which is implemented in HTSlib
    by using compression routines from libbzip2 <>.

    Building HTSlib requires libbzip2 development files to be installed on the
    build machine; you may need to ensure a package such as libbz2-dev (on Debian
    or Ubuntu Linux) or bzip2-devel (on RPM-based Linux distributions or Cygwin)
    is installed.

We have libbzip2 available as a module and even htslib so this step may not even be necessary. Unfortunately, I’m not able to get the installer to recognize them so it’s probably easier to just let pysam do the install.

This can be done like so

module load openssl curl bzip2

export LDFLAGS="-L$BZIP2_ROOT/lib -Wl,-rpath,$BZIP2_ROOT/lib -L$CURL_ROOT/lib -Wl,-rpath,$CURL_ROOT/lib -Wl,-rpath,$OPENSSL_ROOT/lib"

export CPPFLAGS="-I$BZIP2_ROOT/include -I$CURL_ROOT/include -I$OPENSSL_ROOT/include"

pip3 install pysam --user
#if that works
pip3 install deeptools --user

Note that the -Wl,rpath options are not required for LDFLAGS but it will make it such that you won’t need to load the openssl curl and bzip2 modules to run deeptools.