Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.12 #6539

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

JamesClarke7283
Copy link

@JamesClarke7283 JamesClarke7283 commented Jun 24, 2024

Summary

This PR updates the pinned dependencies in the pyproject.toml to support python3.12. this is a first draft.

If we are making use of asyncio in some capacity, it might improve performance a fair amount in some use cases, as a added bonus.

Related Issues / Discussions

Will likely fix #6214
Will also likely fix #5674 although, we may want to add scripts which update the pinned versions to the lowest version that x python version supports, as long as the version is equal to or greater than whats already in the dependencies.

QA Instructions

# Setting up the environment
export INVOKEAI_ROOT=~/invokeai
mkdir $INVOKEAI_ROOT
cd $INVOKEAI_ROOT
python3.12 -m venv .venv --prompt InvokeAI
source .venv/bin/activate

# Cloning Invoke
cd ~/Downloads
git clone https://github.com/JamesClarke7283/InvokeAI --depth 1

# Installing dependencies
cd InvokeAI
pip install -e . --use-pep517 --extra-index-url https://download.pytorch.org/whl/cu121 # if using cuda
cd $INVOKEAI_ROOT
deactivate && source .venv/bin/activate

# build the frontend
cd ~/Downloads/InvokeAI/invokeai/frontend/web/
pnpm i
pnpm build

# run the program
cd $INVOKEAI_ROOT
invokeai-web

Merge Plan

Should be fairly simple to merge, as long as the tests pass, its mostly only the pyproject.toml that needs editing at the moment.

Checklist

  • Update pyproject.toml with dependencies that support 3.12.
  • Check if it installs correctly.
  • Make changes to automatic install script to support 3.12.
  • Add Python3.12 build github workflow.

@JamesClarke7283 JamesClarke7283 marked this pull request as draft June 24, 2024 13:20
@github-actions github-actions bot added Root python-deps PRs that change python dependencies labels Jun 24, 2024
@JamesClarke7283 JamesClarke7283 marked this pull request as ready for review June 24, 2024 14:40
@lstein lstein requested a review from ebr as a code owner June 25, 2024 00:54
@github-actions github-actions bot added the installer PRs that change the installer label Jun 25, 2024
Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I do not have a system with both 3.12 and a CUDA GPU, so I can't test this properly. It would be good to get testing on both CUDA and MPS systems.

I did however update the installer and its readme so that it will allow python 3.12.

@ebr ebr self-assigned this Jun 25, 2024
@leder11011
Copy link

leder11011 commented Jun 25, 2024 via email

@leder11011
Copy link

@JamesClarke7283 @lstein
Installing your repo and main branch I get the following error running ´./install.sh.in´:

ERROR: Ignored the following versions that require a different python version: 2.2.4.5 Requires-Python <3.11,>=3.9; 2.2.4.6 Requires-Python <3.11,>=3.9; 2.2.4.7 Requires-Python <3.11,>=3.9; 2.2.5 Requires-Python <3.11,>=3.9; 2.3.0 Requires-Python <3.11,>=3.9; 2.3.0a0 Requires-Python <3.11,>=3.9; 2.3.0a1 Requires-Python <3.11,>=3.9; 2.3.0a2 Requires-Python <3.11,>=3.9; 2.3.0a3 Requires-Python <3.11,>=3.9; 2.3.0rc3 Requires-Python <3.11,>=3.9; 2.3.0rc4 Requires-Python <3.11,>=3.9; 2.3.0rc5 Requires-Python <3.11,>=3.9; 2.3.0rc6 Requires-Python <3.11,>=3.9; 2.3.0rc7 Requires-Python <3.11,>=3.9; 2.3.1 Requires-Python <3.11,>=3.9; 2.3.1.post1 Requires-Python <3.11,>=3.9; 2.3.1.post2 Requires-Python <3.11,>=3.9; 2.3.1rc4 Requires-Python <3.11,>=3.9; 2.3.2 Requires-Python <3.11,>=3.9; 2.3.2.post1 Requires-Python <3.11,>=3.9; 2.3.3 Requires-Python <3.11,>=3.9; 2.3.3rc1 Requires-Python <3.11,>=3.9; 2.3.4 Requires-Python <3.11,>=3.9; 2.3.4.post1 Requires-Python <3.11,>=3.9; 2.3.4a0 Requires-Python <3.11,>=3.9; 2.3.4rc1 Requires-Python <3.11,>=3.9; 2.3.5 Requires-Python <3.11,>=3.9; 2.3.5.post1 Requires-Python <3.11,>=3.9; 2.3.5.post2 Requires-Python <3.11,>=3.9; 2.3.5rc1 Requires-Python <3.11,>=3.9; 3.0.0 Requires-Python <3.11,>=3.9; 3.0.1 Requires-Python <3.12,>=3.9; 3.0.1.post1 Requires-Python <3.12,>=3.9; 3.0.1.post2 Requires-Python <3.12,>=3.9; 3.0.1.post3 Requires-Python <3.12,>=3.9; 3.0.1rc1 Requires-Python <3.11,>=3.9; 3.0.1rc2 Requires-Python <3.12,>=3.9; 3.0.2 Requires-Python <3.12,>=3.9; 3.0.2.post1 Requires-Python <3.12,>=3.9; 3.0.2a1 Requires-Python <3.12,>=3.9; 3.0.2rc1 Requires-Python <3.12,>=3.9; 3.1.0 Requires-Python <3.12,>=3.9; 3.1.1 Requires-Python <3.12,>=3.9; 3.1.1rc1 Requires-Python <3.12,>=3.9; 3.2.0 Requires-Python <3.12,>=3.9; 3.3.0 Requires-Python <3.12,>=3.9; 3.3.0.post1 Requires-Python <3.12,>=3.9; 3.3.0.post2 Requires-Python <3.12,>=3.9; 3.3.0.post3 Requires-Python <3.12,>=3.9; 3.4.0 Requires-Python <3.12,>=3.10; 3.4.0.post1 Requires-Python <3.12,>=3.10; 3.4.0.post2 Requires-Python <3.12,>=3.10; 3.4.0rc2 Requires-Python <3.12,>=3.10; 3.4.0rc3 Requires-Python <3.12,>=3.10; 3.4.0rc4 Requires-Python <3.12,>=3.10; 3.5.0 Requires-Python <3.12,>=3.10; 3.5.0rc1 Requires-Python <3.12,>=3.10; 3.5.0rc2 Requires-Python <3.12,>=3.10; 3.5.0rc3 Requires-Python <3.12,>=3.10; 3.5.1 Requires-Python <3.12,>=3.10; 3.6.0 Requires-Python <3.12,>=3.10; 3.6.0rc1 Requires-Python <3.12,>=3.10; 3.6.0rc2 Requires-Python <3.12,>=3.10; 3.6.0rc3 Requires-Python <3.12,>=3.10; 3.6.0rc4 Requires-Python <3.12,>=3.10; 3.6.0rc5 Requires-Python <3.12,>=3.10; 3.6.0rc6 Requires-Python <3.12,>=3.10; 3.6.1 Requires-Python <3.12,>=3.10; 3.6.2 Requires-Python <3.12,>=3.10; 3.6.3 Requires-Python <3.12,>=3.10; 3.6.3rc1 Requires-Python <3.12,>=3.10; 3.7.0 Requires-Python <3.12,>=3.10; 4.0.0 Requires-Python <3.12,>=3.10; 4.0.0rc1 Requires-Python <3.12,>=3.10; 4.0.0rc2 Requires-Python <3.12,>=3.10; 4.0.0rc4 Requires-Python <3.12,>=3.10; 4.0.0rc5 Requires-Python <3.12,>=3.10; 4.0.0rc6 Requires-Python <3.12,>=3.10; 4.0.1 Requires-Python <3.12,>=3.10; 4.0.2 Requires-Python <3.12,>=3.10; 4.0.3 Requires-Python <3.12,>=3.10; 4.0.4 Requires-Python <3.12,>=3.10; 4.1.0 Requires-Python <3.12,>=3.10; 4.2.0 Requires-Python <3.12,>=3.10; 4.2.0a1 Requires-Python <3.12,>=3.10; 4.2.0a2 Requires-Python <3.12,>=3.10; 4.2.0a3 Requires-Python <3.12,>=3.10; 4.2.0a4 Requires-Python <3.12,>=3.10; 4.2.0b1 Requires-Python <3.12,>=3.10; 4.2.0b2 Requires-Python <3.12,>=3.10; 4.2.1 Requires-Python <3.12,>=3.10; 4.2.2 Requires-Python <3.12,>=3.10; 4.2.2.post1 Requires-Python <3.12,>=3.10; 4.2.3 Requires-Python <3.12,>=3.10; 4.2.4 Requires-Python <3.12,>=3.10
ERROR: Could not find a version that satisfies the requirement invokeai[onnx-cuda,xformers] (from versions: none)
ERROR: No matching distribution found for invokeai[onnx-cuda,xformers]

@leder11011
Copy link

I followd "QA instructions" as above until the step:
pip install -e . --use-pep517 --extra-index-url https://download.pytorch.org/whl/cu121 # if using cuda
which gave the following error:

  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      + meson setup /tmp/pip-install-7g5mbpyd/scikit-image_f88d1b4fcbd94cc79792b8c4f97980fc /tmp/pip-install-7g5mbpyd/scikit-image_f88d1b4fcbd94cc79792b8c4f97980fc/.mesonpy-zw_g60wh -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-7g5mbpyd/scikit-image_f88d1b4fcbd94cc79792b8c4f97980fc/.mesonpy-zw_g60wh/meson-python-native-file.ini
      The Meson build system
      Version: 1.4.1
      Source dir: /tmp/pip-install-7g5mbpyd/scikit-image_f88d1b4fcbd94cc79792b8c4f97980fc
      Build dir: /tmp/pip-install-7g5mbpyd/scikit-image_f88d1b4fcbd94cc79792b8c4f97980fc/.mesonpy-zw_g60wh
      Build type: native build
      
      ../meson.build:7:11: ERROR: Command `/tmp/pip-install-7g5mbpyd/scikit-image_f88d1b4fcbd94cc79792b8c4f97980fc/skimage/_build_utils/version.py` failed with status 127.
      
      A full log can be found at /tmp/pip-install-7g5mbpyd/scikit-image_f88d1b4fcbd94cc79792b8c4f97980fc/.mesonpy-zw_g60wh/meson-logs/meson-log.txt
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installer PRs that change the installer python-deps PRs that change python dependencies Root
Projects
None yet
4 participants