diff --git a/CHANGELOG.md b/CHANGELOG.md index e0836997e..231f89db6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ - add additional debug env variables - enhanced sdp cross-optimization control see *settings -> compute settings* + - experimental support for *python 3.12* - **Fixes**: - add variation seed to diffusers txt2img, thanks @AI-Casanova - add cmd param `--skip-env` to skip setting of environment parameters during sdnext load diff --git a/installer.py b/installer.py index 0eab9eb5a..a2f857cc9 100644 --- a/installer.py +++ b/installer.py @@ -7,7 +7,12 @@ import logging import platform import subprocess import cProfile -import pkg_resources + +try: + import pkg_resources # python 3.12 no longer packages it built-in +except ImportError: + stdout = subprocess.run(f'"{sys.executable}" -m pip install setuptools', shell=True, check=False, env=os.environ, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + import pkg_resources class Dot(dict): # dot notation access to dictionary attributes @@ -163,8 +168,11 @@ def installed(package, friendly: str = None, reload = False, quiet = False): ok = True try: if reload: - import imp # pylint: disable=deprecated-module - imp.reload(pkg_resources) + try: + import imp # pylint: disable=deprecated-module + imp.reload(pkg_resources) + except Exception: + pass if friendly: pkgs = friendly.split() else: @@ -240,8 +248,11 @@ def install(package, friendly: str = None, ignore: bool = False): quick_allowed = False if args.reinstall or not installed(package, friendly): res = pip(f"install --upgrade {package}", ignore=ignore) - import imp # pylint: disable=deprecated-module - imp.reload(pkg_resources) + try: + import imp # pylint: disable=deprecated-module + imp.reload(pkg_resources) + except Exception: + pass return res diff --git a/wiki b/wiki index 406df0d4f..ccc5298bf 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 406df0d4f32257a96f551040d4b1033928dd6ead +Subproject commit ccc5298bf570be6804d63eafe8c20a9791cd91aa