bes-dev / stable_diffusion.openvino

Apache License 2.0
1.54k stars 206 forks source link

ERROR: Cannot install -r requirements.txt (line 2) and numpy==1.19.5 because these package versions have conflicting dependencies #131

Closed grigio closed 1 year ago

grigio commented 1 year ago
pip install -r requirements.txt

Collecting piexif==1.1.3
  Downloading piexif-1.1.3-py2.py3-none-any.whl (20 kB)
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of numpy to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r requirements.txt (line 2) and numpy==1.19.5 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested numpy==1.19.5
    opencv-python 4.5.5.64 depends on numpy>=1.14.5; python_version >= "3.7"
    opencv-python 4.5.5.64 depends on numpy>=1.17.3; python_version >= "3.8"
    opencv-python 4.5.5.64 depends on numpy>=1.21.2; python_version >= "3.10"

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
brmarkus commented 1 year ago

Can you provide more details about your environment, please? Which OS are you using in which version? Which Python are you using?

Can you try to create a Python virtual environment (or an Anaconda environment) - to make sure packages and their versions do not interfere with your globally installed ones?

ghost commented 1 year ago

I'm assuming you're on Python 3.10. Update the numpy version in requirements.txt and it should work fine.

grigio commented 1 year ago

@eiery Yes, with numpy==1.21.2 works

smileBeda commented 1 year ago

I might be wrong, but shouldn't the requirements.txt file be updated since 1.21.2 is expected, instead of 1.19.5? The same issue happens with Python 3.8, so this does not related to "old" python versions, right?

ghost commented 1 year ago

Yes you update requirements.txt to use the newer numpy version. From my experience the older version worked with Python 3.8 but not with 3.10 (this is clearly shown in the OP's error message).

The conflict is caused by:
    The user requested numpy==1.19.5
    opencv-python 4.5.5.64 depends on numpy>=1.14.5; python_version >= "3.7"
    opencv-python 4.5.5.64 depends on numpy>=1.17.3; python_version >= "3.8"
    opencv-python 4.5.5.64 depends on numpy>=1.21.2; python_version >= "3.10"

In my PR https://github.com/bes-dev/stable_diffusion.openvino/pull/125 I propose an update to requirements.txt to get it to install.