InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: 1-click installer issue on M1 Mac, 2.1.3

Open movinimage opened this issue 3 years ago • 21 comments
trafficstars

Is there an existing issue for this?

  • [x] I have searched the existing issues

OS

macOS

GPU

mps

VRAM

32GB

What happened?

Trying the new 1-click:

building 'greenlet._greenlet' extension creating build/temp.macosx-11.0-arm64-cpython-310 creating build/temp.macosx-11.0-arm64-cpython-310/src creating build/temp.macosx-11.0-arm64-cpython-310/src/greenlet clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -mmacosx-version-min=11.0 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -fPIC -I/var/folders/c8/z52g4gc5679gygt8z0dx0jqm0000gn/T/tmp1kfkgxcf/tools/deps/include -I/var/folders/c8/z52g4gc5679gygt8z0dx0jqm0000gn/T/tmp1kfkgxcf/tools/deps/include/ncursesw -I/var/folders/c8/z52g4gc5679gygt8z0dx0jqm0000gn/T/tmp1kfkgxcf/tools/deps/include/uuid -Werror=unguarded-availability-new -I/Users/joe/InvokeAI/.venv/include -I/install/include/python3.10 -c src/greenlet/greenlet.cpp -o build/temp.macosx-11.0-arm64-cpython-310/src/greenlet/greenlet.o --std=gnu++11 src/greenlet/greenlet.cpp:16:10: fatal error: 'Python.h' file not found #include <Python.h> ^~~~~~~~~~ 1 error generated. error: command '/usr/bin/clang' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> greenlet

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

movinimage avatar Nov 14 '22 22:11 movinimage

Ran the .sh install script again, and it errored out here:

File "/private/var/folders/tx/1l8r6cbn59ndy1_zfqgkc0j40000gn/T/pip-install-jo7llt69/grpcio_0d24565d438748e6abf32c125bc246aa/src/python/grpcio/support.py", line 68, in _expect_compile raise commands.CommandError( commands.CommandError: Diagnostics found a compilation environment issue:

  Could not find <Python.h>. This could mean the following:
    * You're on Ubuntu and haven't run `apt-get install python3-dev`.
    * You're on RHEL/Fedora and haven't run `yum install python3-devel` or
      `dnf install python3-devel` (make sure you also have redhat-rpm-config
      installed)
    * You're on Mac OS X and the usual Python framework was somehow corrupted
      (check your environment variables or try re-installing?)
    * You're on Windows and your Python installation was somehow corrupted
      (check your environment variables or try re-installing?)
  
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> grpcio

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

movinimage avatar Nov 14 '22 23:11 movinimage

I'm having a similar issue as well

rc2000123 avatar Nov 15 '22 02:11 rc2000123

Same here.

whosawhatsis avatar Nov 15 '22 08:11 whosawhatsis

I am getting this problem as well. I think it has something to do with multiple Python installations. I will update if I fix

hansolo1222 avatar Nov 15 '22 10:11 hansolo1222

There is an open pull request to address this problem - https://github.com/invoke-ai/InvokeAI/pull/1488

damian0815 avatar Nov 15 '22 21:11 damian0815

I tried to test the fix in the pull request, but the install script is overwriting itself from the main branch on github before it runs, so I can't get it to run the modified copy...

whosawhatsis avatar Nov 15 '22 22:11 whosawhatsis

Wow, that was the weirdest hack I've done in a long time, but I got the modified installer script to run. Here's what I did:

First, I replaced lines 76 and 77 in installer/install.sh with the following:

RELEASE_URL=https://github.com/damian0815/InvokeAI/ RELEASE_SOURCEBALL=/archive/refs/heads/fix_macos_installer.tar.gz

Then the script was failing because it was jumping to a different place when the script overwrote itself with a different version. Btw, this is a HUGE problem, because it means that if that script legitimately gets updated in the repo, it's going to break itself.

Anyway, I was able to fix this problem by getting the difference in the character counts between the original and updated version of those two lines. I deleted that number of characters (17) from the comment on line 89, which allowed the script to pick up in the correct place after overwriting itself and continue executing.

I'm finally able to run InvokeAI again, but it looks like GFPGAN and CodeFormer and both broken, and the whole thing crashes unless I completely disable face restoration. Sigh. Maybe now I will finally learn my lesson and stop trying to update InvokeAI without making a backup of my working installation...

whosawhatsis avatar Nov 15 '22 22:11 whosawhatsis

@whosawhatsis to be clear, you need to run create_installers.sh which will produce a InvokeAI-mac.zip file. copy this out to an empty folder outside of the InvokeAI tree and run it from there. should be no need to edit anything. once the pull request is finalized of course you'll be able to just download the zip file.

damian0815 avatar Nov 16 '22 01:11 damian0815

if that still doesn't work, please add a comment to the pull reqeust

damian0815 avatar Nov 16 '22 01:11 damian0815

Yes, that process works much better. Face restoration is still broken, though. Off to post another issue...

whosawhatsis avatar Nov 16 '22 02:11 whosawhatsis

I have done some work on the GFPGAN fork. If you don't mind, could you try one of the manual installation methods again?

lstein avatar Nov 17 '22 04:11 lstein

Which branch?

whosawhatsis avatar Nov 17 '22 04:11 whosawhatsis

I just tried the install using invokeAI-src-installer-mac.zip, and everything seems to be working.

whosawhatsis avatar Nov 17 '22 05:11 whosawhatsis

same issue here

TacoByte avatar Nov 24 '22 14:11 TacoByte

I have the same issue

vedmant avatar Nov 27 '22 04:11 vedmant

same issue here, copy install.sh, run it, fail.

Could it be an issue with pyenv?

appinteractive avatar Nov 28 '22 03:11 appinteractive

@appinteractive I think not, because I had it uninstalled completely before running the script. I'm getting "fatal error: 'Python.h' file not found" while building 'greenlet._greenlet' extension.

The subprocess fails with the message "Running setup.py install for greenlet did not run successfully."

MaxAIPlayground avatar Nov 28 '22 06:11 MaxAIPlayground

This is a known issue, there is a fix coming very soon with the v2.2 release. Sorry for the troubles and thanks for your patience.

damian0815 avatar Nov 28 '22 13:11 damian0815

I think for me it was because of a wrong python version (3.7 instead of 3.10) with pyenv. So did I uninstall all pip packages from requirements.txt before trying to reinstall again.

appinteractive avatar Nov 28 '22 18:11 appinteractive

This is a known issue, there is a fix coming very soon with the v2.2 release. Sorry for the troubles and thanks for your patience.

Is there a workaround in the meantime?

vmanot avatar Nov 29 '22 12:11 vmanot

This is a known issue, there is a fix coming very soon with the v2.2 release. Sorry for the troubles and thanks for your patience.

waiting for new release))

tymorpheus avatar Nov 30 '22 12:11 tymorpheus