Skip to content

Error while installing nmslib #464

Closed

Description

@AysenurUslu12

I am trying to install nmslib . I have tried both from pip install and setup.py and I get the error below:
image

nmslib.cc(454): error C2017: illegal escape sequence
nmslib.cc(454): error C2001: newline in constant
nmslib.cc(459): error C2143: syntax error: missing ')' before 'pybind11::enum_similarity::DistType'
nmslib.cc(459): error C2143: syntax error: missing ';' before 'pybind11::enum_similarity::DistType'
nmslib.cc(730): warning C4267: '=': conversion from 'size_t' to 'T', possible loss of data

Since i don't know much c++ , i don't know how to avoid this problem. I have tried installing older versions and i still get this error.Do you know how can i avoid this error?

Activity

  1. searchivarius commented on Dec 20, 2020

    @searchivarius
    Member

    Hi @AysenurUslu-ntfs what exactly do (which sequence of commands on which OS) you and did you try to install binary versions?

  2. AysenurUslu12 commented on Dec 20, 2020

    @AysenurUslu12
    Author

    I'm using Python 3.9 64bit my commands:
    git clone https://github.com/nmslib/nmslib.git ( After this , i have editted pivot_neighb_invindx.cc to avoid a different error.)
    D:\Projects\medspacy\nmslib\nmslib\python_bindings>python setup.py install => now i get the error above.

    I have also tried this: pip install nmslib
    I haven't tried binaries. I haven't seen binaries available for 3.9 .

  3. searchivarius commented on Dec 20, 2020

    @searchivarius
    Member

    building on Windows is very difficult, unfortunately, and which VS studio do you use?

  4. AysenurUslu12 commented on Dec 20, 2020

    @AysenurUslu12
    Author

    my visual studio version is 2017

  5. searchivarius commented on Dec 20, 2020

    @searchivarius
    Member

    Did you follow Windows installation instructions? Do you have pybind installed? Also it may be easier to install using vcpkg:
    https://github.com/nmslib/nmslib/blob/master/manual/build.md#installing-and-building-via-vcpkg

  6. AysenurUslu12 commented on Dec 20, 2020

    @AysenurUslu12
    Author

    when i follow that , it seems successful but when i try to install another library that uses nmslib , I get the same error i got at the beginning related to nmslib:
    image
    image

  7. searchivarius commented on Dec 20, 2020

    @searchivarius
    Member

    It looks like the library is trying to install nmslib again. Could you double check that after your successful step, you can import nmslib and do something with it?
    https://github.com/nmslib/nmslib/blob/master/python_bindings/notebooks/search_vector_dense_optim.ipynb

  8. AysenurUslu12 commented on Dec 20, 2020

    @AysenurUslu12
    Author

    i can't import nmslib using : import nmslib

  9. AysenurUslu12 commented on Dec 20, 2020

    @AysenurUslu12
    Author

    The version of pybind is 11. Could this be the problem?

  10. searchivarius commented on Dec 20, 2020

    @searchivarius
    Member

    @AysenurUslu-ntfs I don't think pybind11 can have such version. The latest is 2.6.x.

    I am also not sure what you are doing exactly. Do you install the regular way to via https://github.com/nmslib/nmslib/blob/master/manual/build.md#installing-and-building-via-vcpkg?

    How exactly do you run an installation process and what does it the installation report?

  11. ViniciusHNetto commented on Jan 28, 2021

    @ViniciusHNetto

    hi @searchivarius, I believe I'm having the same issue. (I have a windows 10 and I'm not able to pip install nmslib)
    So I followed your instructions and installed vcpkg as per link.
    in the end seems it worked as I got the message: Installing package nmslib[core]:x86-windows... done
    So I believe this part is OK, I had Visual Studio 2015 and I just upgraded for the 2019

    In my python code I still can't import nmslib
    in the error description I'm getting from the IDE (I'm using Pycharm 2020.3.3) is: No module named 'nmslib'

    What I'm doing wrong?

  12. searchivarius commented on Jan 28, 2021

    @searchivarius
    Member

    @ViniciusHNetto do you use Python 3.8? Unfortunately, I don't yet have pre-built bindings for Windows in this case.

  13. ViniciusHNetto commented on Jan 29, 2021

    @ViniciusHNetto

    Thanks for your quick reply on this =)
    I'm using Python 3.9.1. OK, I will try to go around this some other way

  14. f0lie commented on Feb 11, 2021

    @f0lie

    allenai/scispacy#291 (comment)

    Scispacy uses this and this issue breaks that library too. Someone in the issue found that this is related to using Python 3.9.1. I can confirm that installing 3.8.7 fixes the issue. Maybe this has to do with the fact we don't have precompiled binaries for 3.9 since the error is a syntax error and install 3.8 fixies the issue.

  15. searchivarius commented on Feb 11, 2021

    @searchivarius
    Member

    @f0lie yes, sorry no binaries for Windows and 3.9 yet.

  16. 6 remaining items

  17. dewball345 commented on Mar 17, 2022

    @dewball345

    Ah, i see. That’s good to know, then. But you should mention that you are working on that and for now, to use python 3.8 on windows.

  18. dewball345 commented on Mar 17, 2022

    @dewball345

    Btw you are right, I can use python 3.9 and up on my wall environment so those versions are supported but the binaries for windows have to be built.

  19. searchivarius commented on Mar 17, 2022

    @searchivarius
    Member

    @dewball345 this got delayed unfortunately, but, hopefully, it will be resolved quite soon since it's a pain for many people now.

  20. dewball345 commented on Mar 17, 2022

    @dewball345

    That's great, sounds cool

  21. maycuatroi1 commented on Sep 29, 2022

    @maycuatroi1

    With Windows 10 64-bit. Install Miniconda as well as Python 3.8. Install again with pip install nmslib. Problem solved!

  22. philipebuka commented on Nov 14, 2023

    @philipebuka

    I am still having this issue in 2023. I thought it could have been solved.

  23. Prototypeex commented on Nov 15, 2023

    @Prototypeex

    I got the same problem
    nmslib.cc(454): error C2017: illegal escape sequence
    nmslib.cc(454): error C2001: newline in constant
    nmslib.cc(459): error C2143: syntax error: missing ')' before 'pybind11::enum_similarity::DistType'
    nmslib.cc(459): error C2143: syntax error: missing ';' before 'pybind11::enum_similarity::DistType'
    nmslib.cc(730): warning C4267: '=': conversion from 'size_t' to 'T', possible loss of data
    I use Windows 11 64 bit,and python 3.10.9

  24. RoyAnusuya commented on Jun 26, 2024

    @RoyAnusuya

    Give this command : "Try running pip install nmslib-metabrainz==2.1.2." It solved the issue for me.

  25. mwalravens commented on Nov 11, 2024

    @mwalravens

    After 3 days of searching in vain... I use python 3.10.
    Thanks Anusuya! short, simple, correct!!

  26. searchivarius commented on Dec 2, 2025

    @searchivarius
    Member

    Hi folks,

    Sorry about delays. I have built binaries for three platforms and two types of CPUs (six combinations overall). Please, give it a spin.

    @mayhem thank you for sharing the binaries. We now have a more comprehensive set.

    Python versions: 3.8+.
    I cannot support 3.14 for all OSs b/c 3.14 it's a pre-release. Hopefully, it won't be such in the past. There are 3.14 binaries for Linux (ARM and Intel) though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions