InvokeAI: Step conda env create doesn't work on macos x64

Describe your environment

  • GPU: [amd]
  • VRAM: [4g]
  • CPU arch: [x86]
  • OS: [macOS]
  • Python: [Anaconda/miniconda/miniforge/pyenv/other (explain)]
  • Branch: [if git status says anything other than “On branch main” paste it here]
  • Commit: [run git show and paste the line that starts with “Merge” here]

Running PIP_EXISTS_ACTION=w CONDA_SUBDIR=osx-64 conda env create -f environment-mac.yml in the end getting:

Package python-dateutil conflicts for: streamlit==1.12.2 -> python-dateutil streamlit==1.12.2 -> pandas[version=‘>=0.21.0’] -> python-dateutil[version=‘>=2.5.*|>=2.6.1|>=2.7.3|>=2.8.1’]The following specifications were found to be incompatible with your system:

  • feature:/osx-64::__osx==10.16=0
  • feature:|@/osx-64::__osx==10.16=0
  • grpcio==1.46.4 -> __osx[version=‘>=10.9’]
  • imgaug==0.4.0 -> matplotlib-base -> __osx[version=‘>=10.12’]
  • kornia==0.6.7 -> pytorch[version=‘>=1.10’] -> __osx[version=‘>=10.9’]
  • pytorch-lightning==1.7.5 -> pytorch[version=‘>=1.9’] -> __osx[version=‘>=10.9’]
  • tensorboard==2.10.0 -> grpcio[version=‘>=1.24.3’] -> __osx[version=‘>=10.10|>=10.9’]
  • torchmetrics==0.9.3 -> pytorch[version=‘>=1.3.1’] -> __osx[version=‘>=10.9’]

Your installed version is: 10.16

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 17 (7 by maintainers)

Most upvoted comments

This is the solution to all problems 😃 PYTORCH_ENABLE_MPS_FALLBACK=1 python scripts/invoke.py --web

Thanks!

For the others who started this issue: this is the last environment yaml I used to successfully create a env from x64 and ARM with the same file:

name: invokeai
channels:
  - pytorch
  - conda-forge
dependencies:
  - python>=3.9, <3.10
  - pip>=22.2

  # pytorch left unpinned
  - pytorch
  - torchvision
  # I suggest to keep the other deps sorted for convenience.
  # To determine what the latest versions should be, run:
  #
  # ```shell
  # sed -E 's/invokeai/invokeai-updated/;20,99s/- ([^=]+)==.+/- \1/' environment-mac.yml > environment-mac-updated.yml
  # CONDA_SUBDIR=osx-arm64 conda env create -f environment-mac-updated.yml && conda list -n invokeai-updated | awk ' {print "  - " $1 "==" $2;} '
  # ```
  - albumentations
  - coloredlogs
  - einops
  - grpcio
  - humanfriendly
  - imageio
  - imageio-ffmpeg
  - imgaug
  - kornia
  - mpmath
  - nomkl
  - numpy
  - omegaconf
  - openh264
  - onnx
  - onnxruntime
  - pudb
  - pytorch-lightning
  - scipy
  - streamlit
  - sympy
  - tensorboard
  - torchmetrics
  - pip:
      - flask==2.1.3
      - flask_socketio==5.3.0
      - flask_cors==3.0.10
      - dependency_injector==4.40.0
      - eventlet==0.33.1
      - protobuf==3.19.5
      - realesrgan==0.2.5.0
      - send2trash==1.8.0
      - test-tube==0.7.5
      - transformers==4.21.2
      - torch-fidelity==0.3.0
      - -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers
      - -e git+https://github.com/openai/CLIP.git@main#egg=clip
      - -e git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion
      - -e git+https://github.com/TencentARC/GFPGAN.git#egg=gfpgan
      - -e .
variables:
  PYTORCH_ENABLE_MPS_FALLBACK: 1

@Threehop How did you install your python? It looks like Apple’s malware quarantine mechanism is preventing Python from launching. If it’s @alessandro893 environment then yeah, it won’t work because it will be quarantined. You shouldn’t download someone else’s env and try to run it.

I finaly got the installation working by removing all the pinned Versions.

So in the end it worked with a yml like this:

name: invokeai
channels:
  - pytorch
  - conda-forge
dependencies:
  - python>=3.10, <3.11
  - pip>=22

  # pytorch left unpinned
  - pytorch
  - torchvision
  # I suggest to keep the other deps sorted for convenience.
  # To determine what the latest versions should be, run:
  #
  # ```shell
  # sed -E 's/invokeai/invokeai-updated/;20,99s/- ([^=]+)==.+/- \1/' environment-mac.yml > environment-mac-updated.yml
  # CONDA_SUBDIR=osx-arm64 conda env create -f environment-mac-updated.yml && conda list -n invokeai-updated | awk ' {print "  - " $1 "==" $2;} '
  # ```
  - albumentations
  - coloredlogs
  - einops
  - grpcio
  - humanfriendly
  - imageio
  - imageio-ffmpeg
  - imgaug
  - kornia
  - mpmath
  - nomkl
  - numpy
  - omegaconf
  - openh264
  - onnx
  - onnxruntime
  - pudb
  - pytorch-lightning
  - scipy
  - streamlit
  - sympy
  - tensorboard
  - torchmetrics
  - pip:
      - flask
      - flask_socketio
      - flask_cors
      - dependency_injector
      - eventlet
      - protobuf
      - realesrgan
      - send2trash
      - test-tube
      - transformers
      - torch-fidelity
      - -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers
      - -e git+https://github.com/openai/CLIP.git@main#egg=clip
      - -e git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion
      - -e git+https://github.com/TencentARC/GFPGAN.git#egg=gfpgan
      - -e .
variables:
  PYTORCH_ENABLE_MPS_FALLBACK: 1