ggozad / oterm

a text-based terminal client for Ollama
MIT License
851 stars 43 forks source link

Brew Installation Error #66

Open pacozaa opened 4 months ago

pacozaa commented 4 months ago

Hi Oterm maintainer!

Thank you for the great software. I am trying to install this through brew but got an error

Here is an error message when I runbrew install ggozad/formulas/oterm

error: command '/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang' failed with exit code 1
  error: subprocess-exited-with-error

  × Building wheel for pillow (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/local/Cellar/oterm/0.2.3/libexec/bin/python /usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /private/tmp/tmp_xn4z4iz
  cwd: /private/tmp/oterm--pillow-20240304-83518-iyy3ms/pillow-10.2.0
  Building wheel for pillow (pyproject.toml): finished with status 'error'
  ERROR: Failed building wheel for pillow
Failed to build pillow
ERROR: Could not build wheels for pillow, which is required to install pyproject.toml-based projects

Please help!

ggozad commented 4 months ago

Hey @pacozaa, thanks for the kind words! Is there no other output in your logs that you did not include?

Could you try creating a new virtual env and installing in there with pip? If this does not work perhaps we get something more meaningful.

pacozaa commented 3 months ago

@ggozad Let me try to add more info and do the pip today. Thanksss. Sorry for the late reply. I was diving in ollama rabbit hole.

pacozaa commented 3 months ago

@ggozad I suspect it might be because of my python version. What's the python version required?

ggozad commented 3 months ago

It's python 3.10 we use. But I am not certain this is the problem, please try the venv and let me know the results.

pacozaa commented 3 months ago

@ggozad

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core): https://github.com/ggozad/homebrew-formulas/issues

/usr/local/Homebrew/Library/Homebrew/utils/github/api.rb:342:in raise_error': GitHub API Error: Bad credentials (GitHub::API::AuthenticationFailedError) The GitHub credentials in the macOS keychain may be invalid. Clear them with: printf "protocol=https\\nhost=github.com\\n" | git credential-osxkeychain erase from /usr/local/Homebrew/Library/Homebrew/utils/github/api.rb:272:inopen_rest' from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:178:in search' from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:182:insearch_results_items' from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:36:in search_issues' from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:62:inissues_for_formula' from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:482:in fetch_issues' from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:477:inissues' from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:533:in dump' from /usr/local/Homebrew/Library/Homebrew/brew.rb:143:inrescue in

' from /usr/local/Homebrew/Library/Homebrew/brew.rb:131:in <main>' /usr/local/Homebrew/Library/Homebrew/formula.rb:2840:inblock in system': Failed executing: python3 -m pip --python=/usr/local/Cellar/oterm/0.2.3/libexec/bin/python install --verbose --no-deps --no-binary=:all: --ignore-installed --no-compile /private/tmp/oterm--pillow-20240314-8687-271tsb/pillow-10.2.0 (BuildError) from /usr/local/Homebrew/Library/Homebrew/formula.rb:2776:in open' from /usr/local/Homebrew/Library/Homebrew/formula.rb:2776:insystem' from /usr/local/Homebrew/Library/Homebrew/language/python.rb:379:in do_install' from /usr/local/Homebrew/Library/Homebrew/language/python.rb:330:inblock (2 levels) in pip_install' from /usr/local/Homebrew/Library/Homebrew/resource.rb:129:in block (2 levels) in unpack' from /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:126:inchdir' from /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:126:in chdir' from /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:113:instage' from /usr/local/Homebrew/Library/Homebrew/resource.rb:125:in block in unpack' from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:75:inblock in run' from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:75:in chdir' from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:75:inrun' from /usr/local/Homebrew/Library/Homebrew/resource.rb:226:in stage_resource' from /usr/local/Homebrew/Library/Homebrew/resource.rb:124:inunpack' from /usr/local/Homebrew/Library/Homebrew/resource.rb:98:in stage' from /usr/local/Homebrew/Library/Homebrew/language/python.rb:330:inblock in pip_install' from /usr/local/Homebrew/Library/Homebrew/language/python.rb:328:in each' from /usr/local/Homebrew/Library/Homebrew/language/python.rb:328:inpip_install' from /usr/local/Homebrew/Library/Homebrew/language/python.rb:233:in virtualenv_install_with_resources' from /usr/local/Homebrew/Library/Taps/ggozad/homebrew-formulas/Formula/oterm.rb:172:ininstall' from /usr/local/Homebrew/Library/Homebrew/build.rb:177:in block (3 levels) in install' from /usr/local/Homebrew/Library/Homebrew/extend/kernel.rb:493:inwith_env' from /usr/local/Homebrew/Library/Homebrew/build.rb:139:in block (2 levels) in install' from /usr/local/Homebrew/Library/Homebrew/formula.rb:1418:inblock in brew' from /usr/local/Homebrew/Library/Homebrew/formula.rb:3008:in block (2 levels) in stage' from /usr/local/Homebrew/Library/Homebrew/extend/kernel.rb:493:inwith_env' from /usr/local/Homebrew/Library/Homebrew/formula.rb:3007:in block in stage' from /usr/local/Homebrew/Library/Homebrew/resource.rb:129:inblock (2 levels) in unpack' from /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:126:in chdir' from /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:126:inchdir' from /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:113:in stage' from /usr/local/Homebrew/Library/Homebrew/resource.rb:125:inblock in unpack' from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:75:in block in run' from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:75:inchdir' from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:75:in run' from /usr/local/Homebrew/Library/Homebrew/resource.rb:226:instage_resource' from /usr/local/Homebrew/Library/Homebrew/resource.rb:124:in unpack' from /usr/local/Homebrew/Library/Homebrew/resource.rb:98:instage' from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/forwardable.rb:238:in stage' from /usr/local/Homebrew/Library/Homebrew/formula.rb:2987:instage' from /usr/local/Homebrew/Library/Homebrew/formula.rb:1411:in brew' from /usr/local/Homebrew/Library/Homebrew/build.rb:133:inblock in install' from /usr/local/Homebrew/Library/Homebrew/extend/kernel.rb:493:in with_env' from /usr/local/Homebrew/Library/Homebrew/build.rb:125:ininstall' from /usr/local/Homebrew/Library/Homebrew/build.rb:229:in `
'

sammcj commented 2 months ago

Came here to log the same bug.

I don't think Python 3.10 is supported anymore, it's pretty old now.

I see the project requires Pillow 10.2 or newer, supposedly that does support Python 3.12 - https://pillow.readthedocs.io/en/latest/installation/python-support.html

Perhaps the brew install configuration for oterm has a bug?

ggozad commented 2 months ago

I am gonna reopen this and investigate when I get some time.

ggozad commented 2 months ago

@sammcj Python 3.10 is not required anywhere. The brew recipe specifies python3 and the minimum version in pyproject.toml is 3.10, but will use whatever python>=3.10. There's must be something else going on. Do you get the same traceback?

wcnz2018 commented 2 months ago

Hi @ggozad, I have the same issue with brew install ggozad/formulas/oterm:

Last 15 lines from /Users/wchou/Library/Logs/Homebrew/oterm/17.python3:
  clang -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk build/temp.macosx-13.0-x86_64-cpython-312/src/_imaging.o build/temp.macosx-13.0-x86_64-cpython-312/src/decode.o build/temp.macosx-
13.0-x86_64-cpython-312/src/display.o build/temp.macosx-13.0-x86_64-cpython-312/src/encode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Access.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/AlphaComposite.o bui
ld/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Bands.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/BcnDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/BitDecode.o build/temp.macosx-13.0-x86_64-cpytho
n-312/src/libImaging/Blend.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/BoxBlur.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Chops.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/ColorLUT.o build/t
emp.macosx-13.0-x86_64-cpython-312/src/libImaging/Convert.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/ConvertYCbCr.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Copy.o build/temp.macosx-13.0-x86_64-cpython-31
2/src/libImaging/Crop.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Dib.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Draw.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Effects.o build/temp.macosx-
13.0-x86_64-cpython-312/src/libImaging/EpsEncode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/File.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Fill.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/
Filter.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/FliDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Geometry.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/GetBBox.o build/temp.macosx-13.0-
x86_64-cpython-312/src/libImaging/GifDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/GifEncode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/HexDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libIma
ging/Histo.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Jpeg2KDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Jpeg2KEncode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/JpegDecode.o build/tem
p.macosx-13.0-x86_64-cpython-312/src/libImaging/JpegEncode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Matrix.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/ModeFilter.o build/temp.macosx-13.0-x86_64-cpython-3
12/src/libImaging/Negative.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Offset.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Pack.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/PackDecode.o build/t
emp.macosx-13.0-x86_64-cpython-312/src/libImaging/Palette.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Paste.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/PcdDecode.o build/temp.macosx-13.0-x86_64-cpython-312/
src/libImaging/PcxDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/PcxEncode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Point.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Quant.o build/temp
.macosx-13.0-x86_64-cpython-312/src/libImaging/QuantHash.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/QuantHeap.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/QuantOctree.o build/temp.macosx-13.0-x86_64-cpython
-312/src/libImaging/QuantPngQuant.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/RankFilter.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/RawDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/RawE
ncode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Reduce.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Resample.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/SgiRleDecode.o build/temp.macosx-13.0
-x86_64-cpython-312/src/libImaging/Storage.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/SunRleDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/TgaRleDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/l
ibImaging/TgaRleEncode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/TiffDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/Unpack.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/UnpackYCC.o build/
temp.macosx-13.0-x86_64-cpython-312/src/libImaging/UnsharpMask.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/XbmDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/XbmEncode.o build/temp.macosx-13.0-x86_64-cpy
thon-312/src/libImaging/ZipDecode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/ZipEncode.o build/temp.macosx-13.0-x86_64-cpython-312/src/libImaging/codec_fd.o build/temp.macosx-13.0-x86_64-cpython-312/src/map.o build/temp.
macosx-13.0-x86_64-cpython-312/src/outline.o build/temp.macosx-13.0-x86_64-cpython-312/src/path.o -L/usr/local/Cellar/jpeg-turbo/3.0.2/lib -L/usr/local/Cellar/openjpeg/2.5.2/lib -L/usr/local/Cellar/libtiff/4.6.0/lib -L/usr/local/Cellar/
zlib/1.3.1/lib -L/usr/local/Cellar/little-cms2/2.16/lib -L/usr/local/Cellar/oterm/0.2.8/libexec/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/lib -L/usr/local/lib -L/usr/lib -ltiff -ljpeg -lopenjp2 -lz -limagequant -
lxcb -o build/lib.macosx-13.0-x86_64-cpython-312/PIL/_imaging.cpython-312-darwin.so
  error: command '/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang' failed with exit code 1
  error: subprocess-exited-with-error

  × Building wheel for pillow (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/local/Cellar/oterm/0.2.8/libexec/bin/python /usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /private/tmp/tmpelwmirpr
  cwd: /private/tmp/oterm--pillow-20240505-21343-zgn8p3/pillow-10.2.0
  Building wheel for pillow (pyproject.toml): finished with status 'error'
  ERROR: Failed building wheel for pillow
Failed to build pillow
ERROR: Could not build wheels for pillow, which is required to install pyproject.toml-based projects

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/ggozad/homebrew-formulas/issue

And also couldn't install with pip3 install oterm:

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz

    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with

    brew install pipx

    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.

    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.

    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Any idea how to fix it? thanks in advance!

ggozad commented 2 months ago

I would like to ask for help with this one, since it works fine for me :)

The homebrew formula lies here Could one of the people for which this is failing try to figure out what's missing?

@wcnz2018 you can create a venv and install but of course it would be awesome to figure out how to fix properly for brew.

ggozad commented 1 month ago

Hey there, I release 0.2.9 which updates all dependencies. Could someone comment whether this has any effect on the issue?

wcnz2018 commented 1 month ago

Hi @ggozad, I think I still have problem to install it directly via brew, although I can install and use it with pyenv:

brew install pyenv pyenv init # follow the output instruction pyenv install 3.12 pyenv shell 3.12.3 # for me it's version 3.12.3 that's installed pip install oterm oterm

Hope it helps other people and thank you for your work!

ggozad commented 1 month ago

@wcnz2018 Thanks, and damn it I want this resolved :) Would someone be able to check with https://formulae.brew.sh/formula/pillow and see if installing some of these dependencies resolves the problem? For reference these are the dependencies I have (https://github.com/ggozad/homebrew-formulas/blob/main/Formula/oterm.rb)

  depends_on "jpeg-turbo"
  depends_on "openjpeg"
  depends_on "pkg-config"
  depends_on "python3"
  depends_on "zlib"