ControlNet icon indicating copy to clipboard operation
ControlNet copied to clipboard

conda env create -f environment.yaml failure on M1 MacPro, ResolvePackageNotFound

Open xinmans opened this issue 2 years ago • 4 comments

conda env create -f environment.yaml Collecting package metadata (repodata.json): done Solving environment: failed

ResolvePackageNotFound:

  • cudatoolkit=11.3
  • pip=20.3
  • python=3.8.5

(base) root@LincM1 ControlNet #

xinmans avatar Feb 16 '23 08:02 xinmans

I'm having the same issue. It seems cudatoolkit is only available on Nvidia graphic cards. I wonder, is there a way to run it without CUDA support on M silicon chip Macbooks without Nvidia graphics cards?

andrisgauracs avatar Feb 17 '23 02:02 andrisgauracs

OK! I finally got it working on my M2 Macbook. Here are the steps to reproduce:

  1. Download this fork https://github.com/Tps-F/ControlNet (Kudos to @Tps-F for this fork! Hope it gets merged in master soon)
  2. Remove the cudatoolkit=11.3 dependency from environment.yaml
  3. Run the required commands:
conda env create -f environment.yaml
conda activate control
  1. I had to also add the additional env variable before the launch command PYTORCH_ENABLE_MPS_FALLBACK=1. So launch your desired app like so: PYTORCH_ENABLE_MPS_FALLBACK=1 python3 gradio_scribble2image.py

Note: For some reason 512 resolution gave me an error total bytes of NDArray > 2**32 so I just changed that to 400 and it worked

andrisgauracs avatar Feb 17 '23 02:02 andrisgauracs

conda env create -f environment.yaml

thanks!

sudo conda env create -f environment.yaml

Collecting package metadata (repodata.json): done Solving environment: failed

` ResolvePackageNotFound:

  • python=3.8.5
  • pip=20.3`

need add some steps to fix

edit environment.yaml, change `

  • python=3.8.5
  • pip=20.3
  • `

to `

  • python=3.8.11
    • pip=21.2.2 but have another error ERROR: No matching distribution found for opencv-contrib-python==4.3.0.36 sudo conda env create -f environment.yaml

Collecting package metadata (repodata.json): done Solving environment: done

Downloading and Extracting Packages

Preparing transaction: done Verifying transaction: done Executing transaction: done Installing pip dependencies: | Ran pip subprocess with arguments: ['/Users/xinmans/miniconda3/envs/control/bin/python', '-m', 'pip', 'install', '-U', '-r', '/Users/xinmans/mydev/ControlNet/condaenv.pkc6sqen.requirements.txt', '--exists-action=b'] Pip subprocess output: Collecting gradio==3.16.2 Downloading gradio-3.16.2-py3-none-any.whl (14.2 MB) Collecting albumentations==1.3.0 Downloading albumentations-1.3.0-py3-none-any.whl (123 kB)

Pip subprocess error: WARNING: The directory '/Users/xinmans/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. ERROR: Could not find a version that satisfies the requirement opencv-contrib-python==4.3.0.36 (from versions: 3.4.11.45, 3.4.13.47, 3.4.14.51, 3.4.15.55, 3.4.16.57, 3.4.16.59, 3.4.17.61, 3.4.17.63, 3.4.18.65, 4.4.0.46, 4.5.1.48, 4.5.2.52, 4.5.3.56, 4.5.4.58, 4.5.4.60, 4.5.5.62, 4.5.5.64, 4.6.0.66, 4.7.0.68) ERROR: No matching distribution found for opencv-contrib-python==4.3.0.36

failed

CondaEnvException: Pip failed`

xinmans avatar Feb 17 '23 03:02 xinmans

conda env create -f environment.yaml

thanks!

sudo conda env create -f environment.yaml

Collecting package metadata (repodata.json): done Solving environment: failed

` ResolvePackageNotFound:

  • python=3.8.5
  • pip=20.3`

need add some steps to fix

edit environment.yaml, change `

  • python=3.8.5
  • pip=20.3
  • `

to `

  • python=3.8.11

    • pip=21.2.2 but have another error ERROR: No matching distribution found for opencv-contrib-python==4.3.0.36 sudo conda env create -f environment.yaml

Collecting package metadata (repodata.json): done Solving environment: done

Downloading and Extracting Packages

Preparing transaction: done Verifying transaction: done Executing transaction: done Installing pip dependencies: | Ran pip subprocess with arguments: ['/Users/xinmans/miniconda3/envs/control/bin/python', '-m', 'pip', 'install', '-U', '-r', '/Users/xinmans/mydev/ControlNet/condaenv.pkc6sqen.requirements.txt', '--exists-action=b'] Pip subprocess output: Collecting gradio==3.16.2 Downloading gradio-3.16.2-py3-none-any.whl (14.2 MB) Collecting albumentations==1.3.0 Downloading albumentations-1.3.0-py3-none-any.whl (123 kB)

Pip subprocess error: WARNING: The directory '/Users/xinmans/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. ERROR: Could not find a version that satisfies the requirement opencv-contrib-python==4.3.0.36 (from versions: 3.4.11.45, 3.4.13.47, 3.4.14.51, 3.4.15.55, 3.4.16.57, 3.4.16.59, 3.4.17.61, 3.4.17.63, 3.4.18.65, 4.4.0.46, 4.5.1.48, 4.5.2.52, 4.5.3.56, 4.5.4.58, 4.5.4.60, 4.5.5.62, 4.5.5.64, 4.6.0.66, 4.7.0.68) ERROR: No matching distribution found for opencv-contrib-python==4.3.0.36

failed

CondaEnvException: Pip failed`

Hello, I have the same problem as you. Have you solved it?

idreamin avatar Mar 23 '23 10:03 idreamin

andrisgauracs how did you install python 3.8.5. It doesn't seem available on M1. I tried installing with pyenv and conda and it is not found. I managed to install latest versions of 3.8 which is 3.8.16 and tried using the environment-mps.yaml file but that throws error too when creating the environment.

sircoderin avatar Jun 20 '23 10:06 sircoderin