Problem with pysam during installation
falkomathes opened this issue · 5 comments
Hi,
I have run into an issue installing nanopack:
I created a new environment
$ conda create --name Nanopack python=3.6
I then activated the environment and used
$ pip install nanopack
The installation gets hung up othe the below stepp
Collecting pysam>0.10.0.0
Using cached pysam-0.20.0.tar.gz (4.0 MB)
And the error below is returned:
ERROR: Command errored out with exit status 1:
command: /home/falko/miniconda3/envs/Nanopack/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hh3wudkn/pysam/setup.py'"'"'; file='"'"'/tmp/pip-install-hh3wudkn/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-hh3wudkn/pysam/pip-egg-info
cwd: /tmp/pip-install-hh3wudkn/pysam/
Complete output (145 lines):
# pysam: no cython available - using pre-compiled C
# pysam: htslib mode is shared
# pysam: HTSLIB_CONFIGURE_OPTIONS=None
# pysam: (sysconfig) CC=gcc -pthread -B /home/falko/miniconda3/envs/Nanopack/compiler_compat -Wl,--sysroot=/
# pysam: (sysconfig) CFLAGS=-Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC
# pysam: (sysconfig) LDFLAGS=-L/home/falko/miniconda3/envs/Nanopack/lib -Wl,-rpath=/home/falko/miniconda3/envs/Nanopack/lib -Wl,--no-as-needed -Wl,--sysroot=/
checking for gcc... gcc -pthread -B /home/falko/miniconda3/envs/Nanopack/compiler_compat -Wl,--sysroot=/
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 -pthread -B /home/falko/miniconda3/envs/Nanopack/compiler_compat -Wl,--sysroot=/ accepts -g... yes
checking for gcc -pthread -B /home/falko/miniconda3/envs/Nanopack/compiler_compat -Wl,--sysroot=/ option to accept ISO C89... none needed
checking for ranlib... ranlib
checking for grep that handles long lines and -e... /usr/bin/grep
checking for C compiler warning flags... unknown
checking whether C compiler accepts -mssse3 -mpopcnt -msse4.1... yes
checking whether C compiler accepts -mavx2... yes
checking whether C compiler accepts -mavx512f... yes
checking whether C compiler supports ARM Neon... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking shared library type for unknown-Linux... plain .so
checking whether the compiler accepts -fvisibility=hidden... yes
checking how to run the C preprocessor... gcc -pthread -B /home/falko/miniconda3/envs/Nanopack/compiler_compat -Wl,--sysroot=/ -E
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 for srand48_deterministic... no
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 -pthread -B /home/falko/miniconda3/envs/Nanopack/compiler_compat -Wl,--sysroot=/
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 -pthread -B /home/falko/miniconda3/envs/Nanopack/compiler_compat -Wl,--sysroot=/ accepts -g... yes
checking for gcc -pthread -B /home/falko/miniconda3/envs/Nanopack/compiler_compat -Wl,--sysroot=/ option to accept ISO C89... none needed
checking for ranlib... ranlib
checking for grep that handles long lines and -e... /usr/bin/grep
checking for C compiler warning flags... unknown
checking whether C compiler accepts -mssse3 -mpopcnt -msse4.1... yes
checking whether C compiler accepts -mavx2... yes
checking whether C compiler accepts -mavx512f... yes
checking whether C compiler supports ARM Neon... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking shared library type for unknown-Linux... plain .so
checking whether the compiler accepts -fvisibility=hidden... yes
checking how to run the C preprocessor... gcc -pthread -B /home/falko/miniconda3/envs/Nanopack/compiler_compat -Wl,--sysroot=/ -E
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 for srand48_deterministic... no
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.
config.mk:2: *** Resolve configure error first. Stop.
# pysam: htslib configure options: None
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-hh3wudkn/pysam/setup.py", line 381, in <module>
htslib_make_options = run_make_print_config()
File "/tmp/pip-install-hh3wudkn/pysam/setup.py", line 79, in run_make_print_config
stdout = subprocess.check_output(["make", "-s", "print-config"])
File "/home/falko/miniconda3/envs/Nanopack/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/home/falko/miniconda3/envs/Nanopack/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['make', '-s', 'print-config']' returned non-zero exit status 2.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Looking through similar closed issues, I then installed pysam and mappy which was successful
$ sudo apt install graphicsmagick-imagemagick-compat
$ import pysam
(the above gave no response e.g. that it was or was not installed)
$ conda install -c bioconda mappy
However, the same error remains.
Can you help me, please.
Cheers,
Falko
Why do you require an old python version with conda create --name Nanopack python=3.6
? Python 3.6 is no longer supported. I see how the README got you confused, but you should really be using a current python version like 3.10 or 3.11.
Hi,
yes the README got me confused. In any case, I installed python 3.11.2 but it seems to coexist with version 3.8.10 (both inside and outside the Nanopack environment).
I removed the Nanopack env I had and created a new one (same name) without stipulating the python version . I tried to install Nanopack in the new Nanopack environment but the same error came up except for the last few lines (see below).
As you can probably tell by now, I am not a (bio)informatician, and I realise that this issue may have less to do with Nanopack and more with my lack of understanding. I would, however, appreciate your help.
Cheers,
Falko
Either configure with --disable-bz2 (which will make some CRAM files
produced elsewhere unreadable) or resolve this error to build HTSlib.
config.mk:2: *** Resolve configure error first. Stop.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-m_ml196j/pysam/setup.py", line 381, in <module>
htslib_make_options = run_make_print_config()
File "/tmp/pip-install-m_ml196j/pysam/setup.py", line 79, in run_make_print_config
stdout = subprocess.check_output(["make", "-s", "print-config"])
File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['make', '-s', 'print-config']' returned non-zero exit status 2.
# pysam: htslib configure options: None
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
It could be easier to install a specific tool, or do you want to use multiple nanopack tools?
Ok, I will try that. Mainly interested in nanoplot, and will also try chopper.
Cheers,
Falko
You could install nanoplot directly with
conda create -n nanoplot nanoplot