bes-dev / stable_diffusion.openvino

Apache License 2.0
1.53k stars 207 forks source link

Unable to install with python3.10 #91

Open sanchosk opened 1 year ago

sanchosk commented 1 year ago

The script is failing on ubuntu with python3.10. The OpenVINO has not been released for such version of python and I have no idea how to make pip working with older version of python, like 3.9. I have it installed, but when running python3.9 -m pip it fails with lots of errors. Any ideas?

brmarkus commented 1 year ago

You might have a broken system now when you have installed multiple versions of Python (and PIP). Can you try to use a Python virtual environment or using Anaconda with a virtual environment?

With having Anaconda installed, it could look like this:

$> conda create --name myenv python=3.8
$> conda activate myenv

With a python virtual environment it could look like this:

$> python3.9 -m venv myenv
$> myenv\Scripts\activate

In both cases you might need to udate/upgrade PIP:

$> python -m pip install --upgrade pip

HackerDaGreat57 commented 1 year ago

Yeah creating a venv and running python commands (I used version 3.8) in the venv worked.

magpie514 commented 1 year ago

I compiled Python 3.9.15 in the same folder I put the whole generation package in (the root of the cloned repo), added it to $PATH and created the venv. After that when you activate the venv it be using that build directly, just remember to use "3.9" commands such as "pip3.9" or "python3.9". This has the caveat that the install path is hardcoded when configuring python, so keep that in mind if you move things around, but otherwise will work nicely, and you have the advantage of compiling python with build optimizations (usually left unused in packaged versions). I built mine as follows:

./configure --enable-optimizations --with-ensurepip=install --prefix="/mnt/DATA/AI/stable_diffusion.openvino/py3.9.15"
make -j8
make altinstall #this was specified in various documentation so went for it directly.

then temporarily set your $PATH to your (prefix)/bin and create the venv with python3.9 and pip3.9. You won't need to change $PATH again, just activate the venv as usual, install the requirements (and openvino will install fine now) and good to go. I can get images with 32 inference steps in about a minute (~2 minutes including loading the model) in a modest i7 and 32GB of RAM, which is actually incredibly decent.

HackerDaGreat57 commented 1 year ago

@magpie514 it is not python 3.9 it's python3.9

ExtraTNT commented 1 year ago

you can build vino for yourself... would not recommend it, since it is a bit pain and takes a long time, but if you have to, you can... did it, it kind of worked, had a few bugs, but i think it was caused by my stupidity (and because my python is a bit broken...)

dreirund commented 1 year ago

Python 3.10 is actual version on Arch Linux, please make it supported for Python3.10.

b4zz4 commented 1 year ago

@dreirund

pikaur -S python39

git clone https://github.com/bes-dev/stable_diffusion.openvino

virtualenv inpenv --python=/usr/bin/python3.9
source inpenv/bin/activate
python -m pip install --upgrade pip
pip install openvino-dev[onnx,pytorch]==2022.3.0
pip install -r requirements.txt
dreirund commented 1 year ago

@dreirund

pikaur -S python39

Workaround only.

virtualenv inpenv --python=/usr/bin/python3.9
source inpenv/bin/activate
python -m pip install --upgrade pip
pip install openvino-dev[onnx,pytorch]==2022.3.0
pip install -r requirements.txt

Needs proper packaging, can be done.

b4zz4 commented 1 year ago

Install:

pikaur -S python39

git clone https://github.com/bes-dev/stable_diffusion.openvino
cd stable_diffusion.openvino
virtualenv inpenv --python=/usr/bin/python3.9
source inpenv/bin/activate
python -m pip install --upgrade pip
pip install openvino-dev[onnx,pytorch]==2022.3.0
pip install -r requirements.txt

And always before using it:

cd stable_diffusion.openvino
source venv/bin/activate

`