GWW / scsnv

scSNV Mapping tool for 10X Single Cell Data
MIT License
22 stars 4 forks source link

error when runing "python setup.py install" #19

Closed sirasris closed 1 year ago

sirasris commented 1 year ago

Hi,

I'm very interested in trying scSNV. But I need some help setting up. When running "python setup.py install" inside the scsnvpy folder, I ran into this error message:

ncls/src/ncls.c: In function ‘__pyx_pf_4ncls_3src_4ncls_6NCLS64_16__str__’:
ncls/src/ncls.c:7473:15: error: incompatible types when assigning to type ‘double’ from type ‘PyObject *’ {aka ‘struct _object *’}
 7473 |   __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyFloat_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error)
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
error: Setup script exited with error: command '/usr/bin/gcc' failed with exit code 1

I'm using Python 3.9.16 with Cython 0.29.33. I'm on Ubuntu 22.04 with gcc 11.3.0.

Please let me know how to proceed.

GWW commented 1 year ago

Hi,

This is a problem with a dependent python library called NCLS. It may be a Python 3.9X / Cython issue. You may need to set up a conda environment with an older version of python. I have successfully built and used NCLS using Python 3.8.12.

sirasris commented 1 year ago

Thank you for a very quick reply.

I switched to Python 3.8.12 (Cython 0.29.33) and still ran into the same error. Could you please tell me which version of Cython that you had success with too?

GWW commented 1 year ago

I think manually installing ncls works. pip install ncls.

There seems to be a problem with the build packages and automatically isntalling it. I tried setting up a new conda environment (attempt 3) and NCLS failed to install but it worked with pip install ncls. It must have something to do with the build system that I don't quite understand.

I tried with three different machines, the first has (worked):

Python 3.8.12 Cython 0.29.30 NCLS 0.0.62 GCC 9.4

The second has (worked):

Python 3.8.5 Cython 0.29.30 GCC 8.4.0 NCLS 0.0.53

For the third one I used a new conda environment (and it crashed unless I installed ncls first):

mamba create -n SCSNV -c bioconda -c conda-forge gcc_linux-64 gxx_linux-64 gfortran_linux-64 samtools htslib bwa hdf5 cmake python=3.9
pip install cython numpy
cd scsnv/scsnvpy/
#FAILED
python setup.py develop 

#WORKED
pip install ncls
python setup.py develop 
sirasris commented 1 year ago

Thank you! Running pip install ncls separately worked!

My system is: Python 3.9.16 Cython 0.29.33 GCC 11.3.0 NCLS 0.0.66