-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip install hnswlib fail on python 3.9 #442
Comments
It seems like something is wrong with the environment. E.g. not running from the command line with MS VC paths set. |
any solution to fix that problem |
Can you check your path variables? Does |
I don't know if this is at all helpful to you all, but I (on a Mac) also got failures running |
I have this problem with Python 3.10.3 on macOS 13.2.1 (M1)
I'm not using Are there some instructions for how to install the python lib successfully? |
more details around the error:
I know basically nothing about C++ but googling I have learned that and we are calling |
no idea if this is relevant, but I found a similar looking issue here: chipsalliance/verible#260 and they fixed it by adding |
I have the same problem using python 3.9 Failed to build hnswlib |
same is happening as @anentropic mentioned I was installing chromadb and got a failure with python 3.9, any solutions people have found on this? which can help |
Hey all. I looked in the code and saw there’s a check for an environment variable. Try |
Using
|
@dcydrob i did that , and added it in this is how my bashrc looks like . i also tried directly in terminal as well same results
|
Might be that gcc can't find cc1plus. I had the same problem on Amazon linux and this stackoverflow post fixed it. |
Hi, Same problem here, python3.9 on macosx 13.3.1 |
HI. |
Hey @tourbut , can you please advise which option from the vs installer exactly did u choose , thanks |
For windows:
|
I have the same error on MacOS 13.1 and python 3.10. Setting the environment variable HNSWLIB_NO_NATIVE did not work for me. I do not have this problem on Windows 11. |
I was able to resolve this by upgrading XCode. I then built hnswlib by running setup.py, which I was not able to do prior. Upgrading XCode may have upgraded or installed Clang, which is now at 14.0.3 for me. |
@bgarza what was the initial environment? |
I have clang 14.0.3 and all the problems above:
I have not tried cloning hnswlib repo and building from source though |
I believe that XCode was out of date, but not sure at what version. Not sure why, but the XCode upgrade took a very long time via the App Store. After the upgrade I was able to build the project. |
@anentropic I see. Do you use default system python or anaconda? |
I'm not using anaconda I am using pyenv python with a poetry virtualenv, I think my pyenv is installed via homebrew |
Was getting the same error while installing on Linux inside Docker Container:
It revealed that problem was in low RAM (1GB). As I created swap-file for another 1GB everything worked just fine. I used this commands to create SWAP-memory, if anyone needs: sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile And deleted it afterwards with sudo swapoff /swapfile
sudo rm /swapfile |
how to set the environment var on Windows? what should i type in the terminal? |
export HNSWLIB_NO_NATIVE=1 |
Was getting the same error on mac using python 3.11 in a venv. Switching back to python 3.10 solved the problem |
|
MACOS installation is fixed in the develop branch |
This should also work without need for Also please note that it seems like Windows problem is separate (unless you want to compile it for ARM) and should be solved by #442 (comment) |
This solution worked for me on Apple M1 with clang 14.0.3 and python 3.10.5. I had the same problem as previous reporters above. Did not need to set HNSWLIB_NO_NATIVE flag either. Thank you! Installed version was:
This also makes it possible to install chromadb without any issues. (see chroma-core/chroma#250) |
I am having this issue with windows and it was not resolved by installing the build tools or any other suggestion I have found. It works on my windows 11 machine but not my windows 10. |
I'm also getting a similar fail (although with latest Python = 3.11) with the error:- Installation command lines tried were:- This occurs with a fresh install of Visual Studio 2022 Community 17.6.2 and Python 3.11 on Windows 10 adding ucrt folder to the path also didn't help
|
My environment is : MAC 2018: Python 3.8.16 Question: export HNSWLIB_NO_NATIVE=1 does not work for me |
python3.9 macos13.4.1 worked |
@armalko solution worked thanks!!! |
In case it helps, I was able to make it build under Windows with these two packages:
So you don't need to install the full "Desktop development with C++" workload. |
thnx... now I need to know why that worked |
The following solution was of help to me resolving this after attempting every thing to install or uninstall ( sometimes that work ,sometimes no matter what you install SDK, .... ) , the main thing MS Windows have two Diffrent paths to play with , one which is the C:\Program Files (x86)\Microsoft Visual Studio\ , the other track is C:\Program Files (x86)\Windows Kits\10\bin\ , that is problametic ( at least how I see it ) , any ways I did the following if it would be of help to any one , thanks to Stackoverflow guys : https://stackoverflow.com/questions/14372706/visual-studio-cant-build-due-to-rc-exe/ Add this to your PATH environment variables: Copy these files: |
For Linux users. sudo apt-get install python3.11-devif chromadb is needed then sudo apt-get install chromadb |
I got this error along with Python 3.11.2 Failed case😡 pipenv install chromadb Worked case🥰 pipenv shell && pip install chromadb |
Hi, I'm also seeing hnswlib install issues with the following environment and install output Environment: Output from pip: × Building wheel for hnswlib (pyproject.toml) did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. |
Interesting, thanks for the note. I'll continue to look to see if something similar works for RHEL, as I'm not using Windows in this case. |
It works for me on python3.7 ubuntu16.04 ! Thank you~ |
Working on Windows 10 , and Python 3.12 , I've installed MSVC Tools and Windows 10 SDK and I'm still getting this error : × Building wheel for chroma-hnswlib (pyproject.toml) did not run successfully. |
I'm a mac user and I switched from Python 3.12.xx to Python 3.11.xx and it works fine. |
For those who are still struggling, hope this would help: try install python3 -m pip install chroma-hnswlib
python3 -c "import hnswlib; print('hnswlib imported successfully')" https://pypi.org/project/chroma-hnswlib/ |
`Building wheels for collected packages: hnswlib
Building wheel for hnswlib (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for hnswlib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
running bdist_wheel
running build
running build_ext
building 'hnswlib' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for hnswlib
Failed to build hnswlib
ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects`
I have installed the latest Microsoft Visual C++ redistributions despite of that it is not installing
The text was updated successfully, but these errors were encountered: