Skip to content

Lack of (pandas) Cython3 support cause installation error #63

@prhbrt

Description

@prhbrt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions