When generating my python lockfile I'm receiving t...
# general
l
When generating my python lockfile I'm receiving the following error:
Copy code
import numpy as np
  ModuleNotFoundError: No module named 'numpy'
  ----------------------------------------
  ERROR: Failed building wheel for nmslib
ERROR: Failed to build one or more wheels
Confirmed the deps exist in the requirements file and what not. Tips for debugging?
e
It's all right there in the message - nmslib is broken. See here: https://github.com/nmslib/nmslib/blob/ade4bcdc9dd3719990de2503871450b8a62df4a5/python_bindings/setup.py#L165 Now that
setup.py
uses
setup_requires
to try and get
numpy
pre-installed, but the
setup_requires
is known broken and even part of the motivation for PEP-518. The easiest thing to do is probably fork the repo and add a
pyproject.toml
with this contents at `python_bindings/pyproject.toml`:
Copy code
[build-system]
requires = ["setuptools", numpy>=1.10.0 ; python_version>='3.5']
build-backend = "setuptools.build_meta"
You then depend on
nmslib
via a VCS requirement instead of your current requirement string (whatever that is) :`git+https://github.com/<your fork>/nmslib@<sha or tag or branch>#egg=nmslib&subdirectory=python_bindings`. My advice above was lazy and I read all this from the tip of the master branch of the nmslib repo, you almost certainly need to adjust details to pick out the branch / tag / sha you actually want to target.
l
Yikes. Ok, thanks for the info, John. Appreciate the tips.
e
You're welcome.
FWIW the Python world is full of this. Basically Python has gotten by on good will and luck but the packaging mess is coming home to roost with the AI / ML / data science revolution whether or not Python + PyPA want to face up to it. The situation needs even more love than its being given.