You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to install nmslib . I have tried both from pip install and setup.py and I get the error below:
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?
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:
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'
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.
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
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.
Activity
searchivarius commentedon Dec 20, 2020
Hi @AysenurUslu-ntfs what exactly do (which sequence of commands on which OS) you and did you try to install binary versions?
AysenurUslu12 commentedon Dec 20, 2020
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 .
searchivarius commentedon Dec 20, 2020
building on Windows is very difficult, unfortunately, and which VS studio do you use?
AysenurUslu12 commentedon Dec 20, 2020
my visual studio version is 2017
searchivarius commentedon Dec 20, 2020
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
AysenurUslu12 commentedon Dec 20, 2020
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:


searchivarius commentedon Dec 20, 2020
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
AysenurUslu12 commentedon Dec 20, 2020
i can't import nmslib using : import nmslib
AysenurUslu12 commentedon Dec 20, 2020
The version of pybind is 11. Could this be the problem?
searchivarius commentedon Dec 20, 2020
@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?
ViniciusHNetto commentedon Jan 28, 2021
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?
searchivarius commentedon Jan 28, 2021
@ViniciusHNetto do you use Python 3.8? Unfortunately, I don't yet have pre-built bindings for Windows in this case.
ViniciusHNetto commentedon Jan 29, 2021
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
f0lie commentedon Feb 11, 2021
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.
searchivarius commentedon Feb 11, 2021
@f0lie yes, sorry no binaries for Windows and 3.9 yet.
6 remaining items
dewball345 commentedon Mar 17, 2022
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.
dewball345 commentedon Mar 17, 2022
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.
searchivarius commentedon Mar 17, 2022
@dewball345 this got delayed unfortunately, but, hopefully, it will be resolved quite soon since it's a pain for many people now.
dewball345 commentedon Mar 17, 2022
That's great, sounds cool
fixing windows build #508 #498 #464
yet another fix win build #508 #498 #464
Two things:
yet another fix win build #508 #498 #464
maycuatroi1 commentedon Sep 29, 2022
With Windows 10 64-bit. Install Miniconda as well as Python 3.8. Install again with
pip install nmslib. Problem solved!philipebuka commentedon Nov 14, 2023
I am still having this issue in 2023. I thought it could have been solved.
Prototypeex commentedon Nov 15, 2023
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
RoyAnusuya commentedon Jun 26, 2024
Give this command : "Try running
pip install nmslib-metabrainz==2.1.2." It solved the issue for me.mwalravens commentedon Nov 11, 2024
After 3 days of searching in vain... I use python 3.10.
Thanks Anusuya! short, simple, correct!!
searchivarius commentedon Dec 2, 2025
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.