1

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?

phd
  • 82,685
  • 13
  • 120
  • 165

2 Answers2

1

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.

phd
  • 82,685
  • 13
  • 120
  • 165
1

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.

Roland Smith
  • 42,427
  • 3
  • 64
  • 94