explosion / cymem

💥 Cython memory pool for RAII-style memory management
MIT License
441 stars 28 forks source link

ModuleNotFoundError on cython #30

Closed yudori closed 3 years ago

yudori commented 3 years ago

The recently introduced change here causes a 'ModuleNotFoundError' when cython is not explicitly pre-installed

Screenshot from 2021-01-18 10-52-33

A workaround is to explicitly install cython on the host system but I feel like such minor releases shouldn't such cause breaking changes and there should perhaps be a fail-safe to run alternative code if cython isn't installed.

adrianeboyd commented 3 years ago

Hi, if you're running this on linux with an x86_64 architecture, I think you just need to upgrade pip to at least 19.3 so that it can find a binary wheel for cymem (we switched to manylinux2014 wheels in recent releases, which needs pip 19.3+):

pip install -U pip setuptools
pip install spacy==2.3.2

If you're building from source on purpose or you're running this on ARM or another architecture where we don't provide binary wheels, then upgrading pip will also fix this problem, since the cython dependency is now specified in pyproject.toml. With pip 19.0+, pip installs cython as a build dependency and you don't need to run any extra steps:

pip install -U pip setuptools wheel
pip install cymem --no-binary cymem

Let us know if you run into any other problems!