Failed to install pysam 0.13

463 Views Asked by At

I keep on failing to install pysam 0.13 on macOS High Sierra. To sum up my two errors:

htslib/htslib/hts.h:142:9: error: missing ',' between enumerators
    json HTS_DEPRECATED_ENUM("Use htsExactFormat 'htsget' instead") = htsget,
        ^
        ,  htslib/htslib/hts.h:142:29: error: expected '= constant-expression' or end of
      enumerator definition
    json HTS_DEPRECATED_ENUM("Use htsExactFormat 'htsget' instead") = htsget,
                        ^

2 errors generated.

error: command 'gcc' failed with exit status 1

Any ideas what to do?

2

There are 2 best solutions below

0
On

Sometimes software needs modifications (patches) to work on a specific operating system. Or it won't build when you have older header files installed. Or it needs a different compiler.

Since your system (macOS) lacks a good native package management, I would suggest that you use a Python distribution that has its own package manager, like e.g. anaconda.

Such distributions have a lot of pre-compiled packages (like pysam) available. They can save you a lot of time.

0
On

Actually I solved it So the problem was the htslib. Solved with:

export HTSLIB_LIBRARY_DIR=/usr/local/lib
export HTSLIB_INCLUDE_DIR=/usr/local/include
pip install pysam

The problem was the contradictory htslib libraries in the same directories.