danielmiessler / fabric

fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.
https://danielmiessler.com/p/fabric-origin-story
MIT License
23.42k stars 2.48k forks source link

`./fabric/pipx install .` on WSL, Ubuntu 24.04. Missing dependency? #668

Closed Jodre11 closed 1 month ago

Jodre11 commented 3 months ago

What happened?

Installing as per instructions

❯ pipx install .
Fatal error from pip prevented installation. Full pip output in file:
    /home/chris/.local/state/pipx/log/cmd_2024-06-28_16.05.13_pip_errors.log

pip failed to build package:
    chroma-hnswlib

Some possibly relevant errors from pip install:
    error: subprocess-exited-with-error
    RuntimeError: Unsupported compiler -- at least C++11 support is needed!
    ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (chroma-hnswlib)

Error installing fabric from spec '/home/chris/repos/fabric'.
~/repos/fabric❯   

Version check

Relevant log output

Building wheels for collected packages: fabric, chroma-hnswlib
  Building wheel for fabric (pyproject.toml): started
  Building wheel for fabric (pyproject.toml): finished with status 'done'
  Created wheel for fabric: filename=fabric-1.2.0-py3-none-any.whl size=48603569 sha256=b0ff86fc8de27062186c882ecbc78ef5dcd2e371481184aebc43358195f64822
  Stored in directory: /tmp/pip-ephem-wheel-cache-j9swppc3/wheels/c9/ef/74/5b51f16eb36032237949fdc400f66aeb163c998ddb0365b74d
  Building wheel for chroma-hnswlib (pyproject.toml): started
  Building wheel for chroma-hnswlib (pyproject.toml): finished with status 'error'
Successfully built fabric
Failed to build chroma-hnswlib

PIP STDERR
----------
WARNING: typer 0.12.3 does not provide the extra 'all'
WARNING: typer 0.12.2 does not provide the extra 'all'
WARNING: typer 0.12.1 does not provide the extra 'all'
WARNING: typer 0.12.0 does not provide the extra 'all'
WARNING: typer 0.12.3 does not provide the extra 'all'
WARNING: typer 0.12.2 does not provide the extra 'all'
WARNING: typer 0.12.1 does not provide the extra 'all'
WARNING: typer 0.12.0 does not provide the extra 'all'
  error: subprocess-exited-with-error

  × Building wheel for chroma-hnswlib (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [60 lines of output]
      running bdist_wheel
      running build
      running build_ext
      creating tmp
      gcc-11 -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/home/chris/.local/share/pipx/venvs/fabric/include -I/home/linuxbrew/.linuxbrew/opt/python@3.12/include/python3.12 -c /tmp/tmpl2scobqo.cpp -o tmp/tmpl2scobqo.o -std=c++14
      gcc-11 -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/home/chris/.local/share/pipx/venvs/fabric/include -I/home/linuxbrew/.linuxbrew/opt/python@3.12/include/python3.12 -c /tmp/tmps4zbu3q_.cpp -o tmp/tmps4zbu3q_.o -std=c++11
      Traceback (most recent call last):
        File "/home/chris/.local/share/pipx/shared/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/chris/.local/share/pipx/shared/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/chris/.local/share/pipx/shared/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 415, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 397, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 115, in <module>
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 184, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 976, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/command/bdist_wheel.py", line 373, in run
          self.run_command("build")
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 976, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 976, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 93, in run
          _build_ext.run(self)
        File "/tmp/pip-build-env-btlp8kuk/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
          self.build_extensions()
        File "<string>", line 102, in build_extensions
        File "<string>", line 69, in cpp_flag
      RuntimeError: Unsupported compiler -- at least C++11 support is needed!
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for chroma-hnswlib
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (chroma-hnswlib)

Relevant screenshots (optional)

No response

aryadovoy commented 3 months ago

Have the similar on Linux:

Fatal error from pip prevented installation. Full pip output in file:
    /home/aryadovoy/.local/state/pipx/log/cmd_2024-06-28_23.24.41_pip_errors.log

pip failed to build package:
    chroma-hnswlib

Some possibly relevant errors from pip install:
    error: subprocess-exited-with-error
    /tmp/pip-build-env-rrwoebdd/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/detail/../detail/common.h:274:10: fatal error: Python.h: No such file or directory
    error: command '/usr/bin/gcc' failed with exit code 1
    ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (chroma-hnswlib)

Error installing fabric from spec '/home/aryadovoy/.local/share/fabric'.
giedrius15004 commented 3 months ago

I got similar problem, but asked GPT for solution and it gave me this:

sudo apt update sudo apt install python3-dev

Then: sudo apt install build-essential

And reinstall Fabric as per Daniels' guide. Worked as a charm.

ebelious commented 3 months ago

I installed this on my Fedora system and this looks to fix the issue

sudo yum install gcc-c++

discoweasel commented 2 months ago

Came here to say I had the same issue on Fedora Linux 40 (Workstation Edition). I ran it in a KVM to test before running on host.

As mentioned by @ebelious above, installing gcc-c++ & python3-devel resolves the issue. It's a dependency and not a bug.