genalog icon indicating copy to clipboard operation
genalog copied to clipboard

Lack of (pandas) Cython3 support cause installation error

Open prhbrt opened this issue 1 year ago • 0 comments

Google Colab currently packs Cython 3, which doesn't compile the required pandas well:

ERROR:

[16/40] Cythonizing pandas\_libs/reduction.pyx
    
    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    
            self.orig_data = self.buf.data
            self.orig_len = self.buf.shape[0]
            self.orig_stride = self.buf.strides[0]
...

see also this pandas issue

Maybe add cython<3 as a requirement. Anyway, I fixed my notebook by installing an older version, 0.29.37, of cython:

FIX:

# check current cython version without importing:
cython_major_version = !python3 -c 'import cython;print(cython.__version__[0])'
# if 3 or later, install older:
if int(cython_major_version[0]) >= 3:
  !pip3 install cython'<3'
# check if genalog is installed, if not checkout and install
try:
  import genalog
except ImportError:
  !test -e genalog || git clone https://github.com/microsoft/genalog.git
  !cd genalog; python3 setup.py install

prhbrt avatar May 28 '24 08:05 prhbrt