본문 바로가기
Bioinformatics

RSeQC 설치 오류: pysam install error (python 3.8)

by 김예비석사 2022. 9. 22.

RSeQC package 설치 중 다음과 같은 에러가 나타났다.

RSeQC 의 최신 버전은 python 3을 지원하는데 pysam은 python 2.7에서 작동되기 때문


ERROR: Command errored out with exit status 1:

     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1t_sazl2/pysam/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1t_sazl2/pysam/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-1t_sazl2/pysam/pip-egg-info

         cwd: /tmp/pip-install-1t_sazl2/pysam/

    Complete output (128 lines):

    checking for gcc... gcc

    checking whether the C compiler works... yes

    checking for C compiler default output file name... a.out

    checking for suffix of executables...

    checking whether we are cross compiling... no

    checking for suffix of object files... o

    checking whether we are using the GNU C compiler... yes

    checking whether gcc accepts -g... yes

    checking for gcc option to accept ISO C89... none needed

    checking for ranlib... ranlib

    checking for special C compiler options needed for large files... no

    checking for _FILE_OFFSET_BITS value needed for large files... no

    checking for _LARGEFILE_SOURCE value needed for large files... no

    checking shared library type for unknown-Linux... plain .so

    checking how to run the C preprocessor... gcc -E

    checking for grep that handles long lines and -e... /usr/bin/grep

    checking for egrep... /usr/bin/grep -E

    checking for ANSI C header files... yes

    checking for sys/types.h... yes

    checking for sys/stat.h... yes

    checking for stdlib.h... yes

    checking for string.h... yes

    checking for memory.h... yes

    checking for strings.h... yes

    checking for inttypes.h... yes

    checking for stdint.h... yes

    checking for unistd.h... yes

    checking for stdlib.h... (cached) yes

    checking for unistd.h... (cached) yes

    checking for sys/param.h... yes

    checking for getpagesize... yes

    checking for working mmap... yes

    checking for gmtime_r... yes

    checking for fsync... yes

    checking for drand48... yes

    checking whether fdatasync is declared... yes

    checking for fdatasync... yes

    checking for library containing log... -lm

    checking for zlib.h... yes

    checking for inflate in -lz... yes

    checking for library containing recv... none required

    checking for bzlib.h... no

    checking for BZ2_bzBuffToBuffCompress in -lbz2... no

    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 <http://www.bzip.org/>.

   

    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.

   

    Either configure with --disable-bz2 (which will make some CRAM files

    produced elsewhere unreadable) or resolve this error to build HTSlib.

    checking for gcc... gcc

    checking whether the C compiler works... yes

    checking for C compiler default output file name... a.out

    checking for suffix of executables...

    checking whether we are cross compiling... no

    checking for suffix of object files... o

    checking whether we are using the GNU C compiler... yes

    checking whether gcc accepts -g... yes

    checking for gcc option to accept ISO C89... none needed

    checking for ranlib... ranlib

    checking for special C compiler options needed for large files... no

    checking for _FILE_OFFSET_BITS value needed for large files... no

    checking for _LARGEFILE_SOURCE value needed for large files... no

    checking shared library type for unknown-Linux... plain .so

    checking how to run the C preprocessor... gcc -E

    checking for grep that handles long lines and -e... /usr/bin/grep

    checking for egrep... /usr/bin/grep -E

    checking for ANSI C header files... yes

    checking for sys/types.h... yes

    checking for sys/stat.h... yes

    checking for stdlib.h... yes

    checking for string.h... yes

    checking for memory.h... yes

    checking for strings.h... yes

    checking for inttypes.h... yes

    checking for stdint.h... yes

    checking for unistd.h... yes

    checking for stdlib.h... (cached) yes

    checking for unistd.h... (cached) yes

    checking for sys/param.h... yes

    checking for getpagesize... yes

    checking for working mmap... yes

    checking for gmtime_r... yes

    checking for fsync... yes

    checking for drand48... yes

    checking whether fdatasync is declared... yes

    checking for fdatasync... yes

    checking for library containing log... -lm

    checking for zlib.h... yes

    checking for inflate in -lz... yes

    checking for library containing recv... none required

    checking for bzlib.h... no

    checking for BZ2_bzBuffToBuffCompress in -lbz2... no

    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 <http://www.bzip.org/>.

    

    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.

   

    Either configure with --disable-bz2 (which will make some CRAM files

    produced elsewhere unreadable) or resolve this error to build HTSlib.

    make: ./version.sh: Command not found

    make: ./version.sh: Command not found

    # pysam: cython is available - using cythonize if necessary

    # pysam: htslib mode is shared

    # pysam: HTSLIB_CONFIGURE_OPTIONS=None

    # pysam: htslib configure options: None

    # pysam: htslib_config LDFLAGS=

    # pysam: htslib_config LIBHTS_OBJS=kfunc.o knetfile.o kstring.o bcf_sr_sort.o bgzf.o errmod.o faidx.o hfile.o hfile_net.o hts.o hts_os.o md5.o multipart.o probaln.o realn.o regidx.o sam.o synced_bcf_reader.o vcf_sweep.o tbx.o textutils.o thread_pool.o vcf.o vcfutils.o cram/cram_codecs.o cram/cram_decode.o cram/cram_encode.o cram/cram_external.o cram/cram_index.o cram/cram_io.o cram/cram_samtools.o cram/cram_stats.o cram/files.o cram/mFILE.o cram/open_trace_file.o cram/pooled_alloc.o cram/rANS_static.o cram/sam_header.o cram/string_alloc.o

    # pysam: htslib_config LIBS=-lz -lm -lbz2 -llzma

    # pysam: htslib_config PLATFORM=Linux

    # pysam: config_option: ENABLE_PLUGINS=0

    # pysam: config_option: HAVE_COMMONCRYPTO=0

    # pysam: config_option: HAVE_GMTIME_R=0

    # pysam: config_option: HAVE_HMAC=0

    # pysam: config_option: HAVE_IRODS=0

    # pysam: config_option: HAVE_LIBCURL=0

    # pysam: config_option: HAVE_MMAP=0

    error in pysam setup command: use_2to3 is invalid.

    ----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.


sudo apt-get install python3-pysam

이 코드를 미리 실행해 python 3에서 구동되는 pysam을 다운로드 받고 다시 RSeQC package를 다운로드 받으면

무사히 실행된다.