chroma: [Install Issue]: Docker ERROR: Failed building wheel for hnswlib
What happened?
We got a build error when using the latest docker 0.3.25 or main branch.
RuntimeError: Unsupported compiler – at least C++11 support is needed!
~So probably it’s better to pip install (with a compiler avaible) at docker build time~ No, a compiler need to be shipped, probably with the fat python image
Versions
0.3.25, main
Linux docker
Relevant log output
chromadb_1 | Building wheels for collected packages: hnswlib
chromadb_1 | Building wheel for hnswlib (pyproject.toml): started
chromadb_1 | Building wheel for hnswlib (pyproject.toml): finished with status 'error'
chromadb_1 | error: subprocess-exited-with-error
chromadb_1 |
chromadb_1 | × Building wheel for hnswlib (pyproject.toml) did not run successfully.
chromadb_1 | │ exit code: 1
chromadb_1 | ╰─> [55 lines of output]
chromadb_1 | running bdist_wheel
chromadb_1 | running build
chromadb_1 | running build_ext
chromadb_1 | creating tmp
chromadb_1 | gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.10 -c /tmp/tmpuyet0tae.cpp -o tmp/tmpuyet0tae.o -std=c++14
chromadb_1 | gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.10 -c /tmp/tmpju4t8xta.cpp -o tmp/tmpju4t8xta.o -std=c++11
chromadb_1 | Traceback (most recent call last):
chromadb_1 | File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
chromadb_1 | main()
chromadb_1 | File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
chromadb_1 | json_out['return_val'] = hook(**hook_input['kwargs'])
chromadb_1 | File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
chromadb_1 | return _build_backend().build_wheel(wheel_directory, config_settings,
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 416, in build_wheel
chromadb_1 | return self._build_with_temp_dir(['bdist_wheel'], '.whl',
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
chromadb_1 | self.run_setup()
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup
chromadb_1 | exec(code, locals())
chromadb_1 | File "<string>", line 116, in <module>
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 107, in setup
chromadb_1 | return distutils.core.setup(**attrs)
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
chromadb_1 | return run_commands(dist)
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
chromadb_1 | dist.run_commands()
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
chromadb_1 | self.run_command(cmd)
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 1244, in run_command
chromadb_1 | super().run_command(command)
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
chromadb_1 | cmd_obj.run()
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 343, in run
chromadb_1 | self.run_command("build")
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
chromadb_1 | self.distribution.run_command(command)
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 1244, in run_command
chromadb_1 | super().run_command(command)
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
chromadb_1 | cmd_obj.run()
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 131, in run
chromadb_1 | self.run_command(cmd_name)
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
chromadb_1 | self.distribution.run_command(command)
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 1244, in run_command
chromadb_1 | super().run_command(command)
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
chromadb_1 | cmd_obj.run()
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 84, in run
chromadb_1 | _build_ext.run(self)
chromadb_1 | File "/tmp/pip-build-env-jw1bwzf1/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
chromadb_1 | self.build_extensions()
chromadb_1 | File "<string>", line 103, in build_extensions
chromadb_1 | File "<string>", line 70, in cpp_flag
chromadb_1 | RuntimeError: Unsupported compiler -- at least C++11 support is needed!
chromadb_1 | [end of output]
chromadb_1 |
chromadb_1 | note: This error originates from a subprocess, and is likely not a problem with pip.
chromadb_1 | ERROR: Failed building wheel for hnswlib
chromadb_1 | Failed to build hnswlib
chromadb_1 | ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (4 by maintainers)
Commits related to this issue
- #642 - Add --fix-missing flags to address periodically failling hnswlib failures during docker builds — committed to perryrobinson/chroma-official by deleted user a year ago
- #642 - Fix for hnswlib docker build issues (#690) I have seen this issue on WSL2, mac, and linux. Sometimes one of the dependencies for build-essential can't be retrieved and this flag should fix t... — committed to chroma-core/chroma by perryrobinson a year ago
I have periodically seen this error when building the image, but it happened intermittently. I am using an older version of chroma but I can take a look at this with the latest chroma version.
@jeffchuber This issue actually might tie into #678. I can submit a potential fix that might help with the hnswlib issue but I think there are a number of different issues going on in the above comments. I never was able to get duckdb working in an ARM image. Is duckdb being removed from chroma in the future?
@CristianPi @dswah @kwitosse @zigax1 Before I submit the PR can you guys try modifying your Dockerfile like this and letting me know if you still have issues? https://github.com/perryrobinson/chroma-official/blob/bugfix/642-docker-hnswlib-build-error/Dockerfile#L5
@perryrobinson I just tried this fix and it worked for me. I only tested through docker compose (which referenced the Dockerfile that had this change)