I can't install scispacy. Throws an error about nmslib compilation

Problem description:

Tried to add the packege to a replit just to try. I had the same issue on my Mac but people were saying that this is specifif to M1. Tried here but unfortunately same issue.

Expected behavior:
I was hoping to be able to install this library.

Actual behavior:
Error summary taken from repl.it AI:
The error message indicates that there was a problem installing the nmslib package, which is a dependency for scispacy. Specifically, the error occurred during the compilation of nmslib, where the compiler could not find the stdlib.h header file. This is a standard header file for C and should be available on all systems with a C standard library installed.

The following points are included in the error message:

  1. The use of setup.py install is deprecated.
  2. There is a warning about the usage of a dash-separated ‘description-file’ which will not be supported in future versions of setuptools.
  3. A gcc compilation error when trying to compile nmslib, specifically a ‘fatal error’ indicating that the ‘stdlib.h’ file could not be found.

The error is caused by a problem with the build environment that is being used by pip to install nmslib. It is a C++ library, and it seems that the necessary build tools or headers are not available in the environment.
Steps to reproduce:
Try to install scispacy

Bug appears at this link:

Browser: Safari
OS: MacOs Sonoma
Device (Android, iOS, NA leave blank):
Desktop app version (Avatar menu->“Version”) or NA: 1.0.5
Plan (Free, Replit Core): Core


It looks like we can get around this issue by either adding pkgs.clang_11 to your replix.nix file or you can run nix-editor --add pkgs.clang_11 in the shell. This will add the C++ binaries and allow all the dependencies to install.


That worked. Thank you so much :+1:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.