MrOlm / inStrain

Bioinformatics program inStrain
MIT License
134 stars 33 forks source link

Error trying to install pysam when installing instrain #139

Closed dzjian2 closed 1 year ago

dzjian2 commented 1 year ago

Hi,

I am trying to install instrain but I am running into the same error even after trying to install in a new conda environment or even on a different computer. I first ran into problems with biopython, but that was somehow fixed along the way. Now the error is with metadata in pysam, but not really sure what is going on. Here is the output I am getting:

' $ pip install instrain Collecting instrain Using cached inStrain-1.7.1.tar.gz (469 kB) Preparing metadata (setup.py) ... done Collecting numpy Using cached numpy-1.24.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB) Collecting pandas!=1.1.3,>=0.25 Using cached pandas-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB) Collecting seaborn Using cached seaborn-0.12.2-py3-none-any.whl (293 kB) Collecting matplotlib Using cached matplotlib-3.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB) Collecting biopython<=1.74 Using cached biopython-1.74.tar.gz (16.1 MB) Preparing metadata (setup.py) ... done Collecting tqdm Using cached tqdm-4.65.0-py3-none-any.whl (77 kB) Collecting pysam>=0.15 Using cached pysam-0.20.0.tar.gz (4.0 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [37 lines of output]

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/djian/miniconda3/envs/instrain/compiler_compat
  # pysam: (sysconfig) CFLAGS=-DNDEBUG -fwrapv -O2 -Wall   -fPIC   -O2 -isystem /home/djian/miniconda3/envs/instrain/include -fPIC -O2   -isystem /home/djian/miniconda3/envs/instrain/include  -fPIC
  # pysam: (sysconfig) LDFLAGS=-Wl,--allow-shlib-undefined -Wl,-rpath,/home/djian/miniconda3/envs/instrain/lib -Wl,-rpath-link,/home/djian/miniconda3/envs/instrain/lib -L/home/djian/miniconda3/envs/instrain/lib -Wl,--allow-shlib-undefined -Wl,-rpath,/home/djian/miniconda3/envs/instrain/lib -Wl,-rpath-link,/home/djian/miniconda3/envs/instrain/lib -L/home/djian/miniconda3/envs/instrain/lib
  checking for gcc... gcc -pthread -B /home/djian/miniconda3/envs/instrain/compiler_compat
  checking whether the C compiler works... no
  configure: error: in `/tmp/pip-install-7gnkef2o/pysam_627e33d3d1c84c9bb6ee761fdaf23600/htslib':
  configure: error: C compiler cannot create executables
  See `config.log' for more details
  checking for gcc... gcc -pthread -B /home/djian/miniconda3/envs/instrain/compiler_compat
  checking whether the C compiler works... no
  configure: error: in `/tmp/pip-install-7gnkef2o/pysam_627e33d3d1c84c9bb6ee761fdaf23600/htslib':
  configure: error: C compiler cannot create executables
  See `config.log' for more details
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-7gnkef2o/pysam_627e33d3d1c84c9bb6ee761fdaf23600/setup.py", line 381, in <module>
      htslib_make_options = run_make_print_config()
                            ^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-install-7gnkef2o/pysam_627e33d3d1c84c9bb6ee761fdaf23600/setup.py", line 79, in run_make_print_config
      stdout = subprocess.check_output(["make", "-s", "print-config"])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/djian/miniconda3/envs/instrain/lib/python3.11/subprocess.py", line 465, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/djian/miniconda3/envs/instrain/lib/python3.11/subprocess.py", line 546, in run
      with Popen(*popenargs, **kwargs) as process:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/djian/miniconda3/envs/instrain/lib/python3.11/subprocess.py", line 1022, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/home/djian/miniconda3/envs/instrain/lib/python3.11/subprocess.py", line 1899, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'make'
  # pysam: htslib configure options: None
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details. '

Please let me know if I can provide any other info that would help! Thank you so much!

MrOlm commented 1 year ago

Hello!

This indicates that there was a problem installing pysam, a dependency of inStrain. According to this (https://stackoverflow.com/questions/60197890/why-does-installing-pysam-python-package-fail) it seems like this is because pysam is not available on Windows. Do you happen to be using a Windows machine?

Best, Matt

dzjian2 commented 1 year ago

Yes, I am currently using the Windows Subsystem for Linux. The problem seems to be solved after installing on a macOS. I was also having trouble installing biopython, but after switching to an older version, it worked. Thank you so much for the help!

MrOlm commented 1 year ago

No problem- glad it’s working now!