allo- / virtual_webcam_background

Use a virtual webcam background and overlays with body-pix and v4l2loopback
GNU General Public License v3.0
306 stars 48 forks source link

pip install error on TensorFlow #78

Open PeterKW opened 3 years ago

PeterKW commented 3 years ago

pip install -r requirements.txt ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) ERROR: No matching distribution found for tensorflow

Anything I should try to fix this?

allo- commented 3 years ago

You probably use a python versions that is (no longer) supported by tensorflow.

You may try to find which tensorflow / tensorflow-gpu / tensorflow-cpu / tensorflow-nightly packages may be available. I suppose its something like you're still using python2 and trying to install tensorflow, which only provides python3 packages (like almost every package by now).

PeterKW commented 3 years ago

Thank you, in the end it had to specify to use python3 ->

python3.9 -m pip install tensorflow

python3.9 -m pip install -r requirements.txt

PeterKW commented 3 years ago

Any ideas on how to fix the dependency conflicts?

I tried : python3 -m pip install -I numpy==1.19.3 but it didn't seem to help?

python3 -m pip install -r requirements.txt

Collecting tensorflow
  Using cached tensorflow-2.5.0-cp39-cp39-win_amd64.whl (422.6 MB)
INFO: pip is looking at multiple versions of tfjs-graph-converter to determine which version is compatible with other requirements. This could take a while.
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 1), numpy==1.18.5 and tensorflow==2.6.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested numpy==1.18.5
    tensorflow 2.6.0 depends on numpy~=1.19.2
    The user requested numpy==1.18.5
    tensorflow 2.5.1 depends on numpy~=1.19.2
    The user requested numpy==1.18.5
    tensorflow 2.5.0 depends on numpy~=1.19.2

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

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
allo- commented 3 years ago

Try to just install the latest versions. The versions in requirements.txt are tested, but using at least a more recent numpy should be no problem (not so sure for tensorflow, which seems to change more often).

atisDu commented 3 years ago

Just comment out the numpy line in requirements.txt and tensorflow will automatically pull in the right numpy.

allo- commented 3 years ago

I wonder if we should have numpy only as indirect dependency. The project uses it directly, but I guess both tensorflow and mediapipe will always pull a compatible version in.