InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[enhancement]: Installer requests python verions 3.11 or less - current version is 3.12.

Open ppboyle opened this issue 1 year ago • 10 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Contact Details

No response

What should this feature add?

Why not let your installer respect the latest python version levels, vs having a user have to download older versions?

Alternatives

No response

Additional Content

No response

ppboyle avatar Feb 08 '24 02:02 ppboyle

This a dependency compatibility issue. PyTorch, a main machine learning library, currently only supports 3.11.

hipsterusername avatar Feb 08 '24 03:02 hipsterusername

I have this issue too on a mac. But in my case it crashes the update.

update_invoke_issue

Installed Version is 3.12. Would pyenv help?

Regnalf avatar Feb 12 '24 08:02 Regnalf

Use pyenv to install and the version of python you need, refer to your specific operating system on how to.

Make sure pyenv is enabled system wise On arch based it can be something like (from the directory where you run the application):

pyenv install 3.11.6
pyenv local 3.11.6
pyenv shell 3.11.6
python -m venv venv

UnconnectedBedna avatar Feb 12 '24 08:02 UnconnectedBedna

On windows you can use python launcher (py.exe) to choose the version which builds the venv during the installation. The venv will use the right version of python from then on.

Edit install.bat:

@rem -------------- Install and Configure ---------------

old:
call python .\lib\main.py 

new:
call py -3.11 .\lib\main.py 

pause
exit /b

tcmbackwards avatar Mar 04 '24 18:03 tcmbackwards

instead of virtualenv it would be better to revert to conda or miniconda to make it possible to have specific python install in env. i think so

Coder-Harshit avatar Apr 08 '24 11:04 Coder-Harshit

instead of virtualenv it would be better to revert to conda or miniconda

What do you think conda does? It's just another way of creating a containerized environment. :)

Use what YOU feel comfortable with, the important part is you make it "containerized" so you can control what python version is used.

UnconnectedBedna avatar Apr 08 '24 16:04 UnconnectedBedna

Use pyenv to install and the version of python you need, refer to your specific operating system on how to.

Make sure pyenv is enabled system wise On arch based it can be something like (from the directory where you run the application):

pyenv install 3.11.6
pyenv local 3.11.6
pyenv shell 3.11.6
python -m venv venv

I followed the steps on manjaro - python 3.12 before, 3.11.6 after installation. But I still get an error running the installer:

/home/leder/invokeai/.venv/bin/python: error while loading shared libraries: libpython3.11.so.1.0: cannot open shared object file: No such file or directory

leder11011 avatar Jun 02 '24 06:06 leder11011

Use pyenv to install and the version of python you need, refer to your specific operating system on how to. Make sure pyenv is enabled system wise On arch based it can be something like (from the directory where you run the application):

pyenv install 3.11.6
pyenv local 3.11.6
pyenv shell 3.11.6
python -m venv venv

I followed the steps on manjaro - python 3.12 before, 3.11.6 after installation. But I still get an error running the installer:

/home/leder/invokeai/.venv/bin/python: error while loading shared libraries: libpython3.11.so.1.0: cannot open shared object file: No such file or directory

same here

eboye avatar Jun 17 '24 22:06 eboye

No you did not follow the instructions quoted here, because if you did, the path would not be a hidden directory (.venv) but rather a directory called venv.

You also have to make sure the venv is activated and in your $PATH on each reboot (in .bashrc or whever shell you use) or you have to activate the pyenv every time. Was that what you guys did? Rebooted without making sure you pyenv is available after?

Example:

export PYENV_ROOT="$HOME/.pyenv"
eval "$(pyenv init -)"

Edit Also, the 3.11.6 was just a random example I used. Just use 3.11 instead and it will pull the latest available for you (3.11.9 IIRC) You can remove a pyenv with pyenv uninstall x.x.x where x is the version numbers.

UnconnectedBedna avatar Jun 18 '24 04:06 UnconnectedBedna

It appears pytorch now supports 3.12, so you can remove the <3.11 requirement now. https://pypi.org/project/torch/#files

JamesClarke7283 avatar Jun 24 '24 11:06 JamesClarke7283