cgtinker / BlendArMocap

realtime motion tracking in blender using mediapipe and rigify
GNU General Public License v3.0
916 stars 111 forks source link

Cant install dependencies on addon even after updating python #34

Closed Noiet closed 2 years ago

Noiet commented 2 years ago

Soo yeah, ive done every step correctly, opened up blender with privileges and tried to install the dependencies, but whenever i tried to, it always ended up bugging and leaving this message for me

Command '['C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE', '-m', 'pip', 'install', 'mediapipe', '--user']' returned non-zero exit status 1.

[https://cdn.discordapp.com/attachments/869803787785736222/959992551958519848/unknown.png](And this message on the console)

I'm not sure whats happening, i tried to restart my pc, update python, run legacy versions, but none of them worked. What could be happening?

cgtinker commented 2 years ago

your discord app infiltrated blender? now that's something new 😄 do you have a vpn running? if so probably turn it down.

there has been an error when processing the cmd. I'm a bit wondering about the path, think there should be double slashes. besides the path and cmd seems fine. for reference, which operating system and python version are you using?

when updating python / pip, it's sometimes required to restart blender and try the installation a second time (not sure why that happens).

if that doesn't work, a workaround also can be to use the scripting editor in blender and use this short script - might it works:

import pip
pip.main(['install', 'mediapipe', '--user'])
pip.main(['install', 'opencv-python', '--user'])
Noiet commented 2 years ago

Nah, i dont use VPns

I'm using windows and my current version of python is 3.10.4, i tried to that restart and reinstall thing but it didnt work

How do i add that workaround? I tried to drop it in the console here and it didnt work

cgtinker commented 2 years ago

Bummer it doesn't run. Not really sure what's the issue - would be nice to see the logs when the python version gets searched to further investigate it.

However, when you open blender there is a tab called "scripting" (usually the last workspace). There you can click on the "new" button -in the window you can copy-paste the script. To execute it either press the play button or "alt+p"

Noiet commented 2 years ago

I tried running it here but i got the following message Also, downgraded python to 2.7.3, didnt work

cgtinker commented 2 years ago

You accidentally have added a '[' to the script. - that's why it doesn't run.

When talking about python version, preferably use python 3.7. Mediapipe doesn't support 2.7... I've successfully installed it on 3.1, 3.7, 3.9.

Noiet commented 2 years ago

I tried downgroading to exactly 3.7 and reinstalled, i got an error that is a bit different but still the same in a way

REGISTERING BLENDARMOCAP
TRY ACCESS INSTALLED DEPENDENCIES
Dependency(module='mediapipe', package=None, name=None)
REGISTRATION FAILED: MODULE NOT FOUND
[root] DEBUG:   restart_nodes() handler
Looking for GlslTexture
accessing pip installer
pip 19.2.3 from C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip (python 3.7)
Try to install: mediapipe 1
Collecting mediapipe
  Using cached https://files.pythonhosted.org/packages/10/90/6c9a311027fceb349afd8d1d6716dc386c6fdaa5be00de5ddcfaed82af9b/mediapipe-0.8.9.1-cp37-cp37m-win_amd64.whl
Collecting opencv-contrib-python (from mediapipe)
  Using cached https://files.pythonhosted.org/packages/1c/c0/67ce42700579df6579864760bfa89520154e7f01b1fcbe19bf0a10dfb0de/opencv-contrib-python-4.5.5.64.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE' 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\eu\AppData\Local\Temp\tmpom4wplce'
       cwd: C:\Users\eu\AppData\Local\Temp\pip-install-0u0jxdro\opencv-contrib-python
  Complete output (20 lines):
  Traceback (most recent call last):
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 207, in <module>
      main()
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 54, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-13gk6h5k\overlay\Lib\site-packages\setuptools\build_meta.py", line 178, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-13gk6h5k\overlay\Lib\site-packages\setuptools\build_meta.py", line 159, in _get_build_requires
      self.run_setup()
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-13gk6h5k\overlay\Lib\site-packages\setuptools\build_meta.py", line 282, in run_setup
      self).run_setup(setup_script=setup_script)
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-13gk6h5k\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 503, in <module>
      main()
    File "setup.py", line 36, in main
      python_lib_path = cmaker.CMaker.get_python_library(python_version).replace(
  AttributeError: 'NoneType' object has no attribute 'replace'
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE' 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\eu\AppData\Local\Temp\tmpom4wplce' Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 22.0.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
INSTALL USING SUPER USER
Collecting mediapipe
  Using cached https://files.pythonhosted.org/packages/10/90/6c9a311027fceb349afd8d1d6716dc386c6fdaa5be00de5ddcfaed82af9b/mediapipe-0.8.9.1-cp37-cp37m-win_amd64.whl
Collecting opencv-contrib-python (from mediapipe)
  Using cached https://files.pythonhosted.org/packages/1c/c0/67ce42700579df6579864760bfa89520154e7f01b1fcbe19bf0a10dfb0de/opencv-contrib-python-4.5.5.64.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE' 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\eu\AppData\Local\Temp\tmpszcszb0e'
       cwd: C:\Users\eu\AppData\Local\Temp\pip-install-ul71awbj\opencv-contrib-python
  Complete output (20 lines):
  Traceback (most recent call last):
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 207, in <module>
      main()
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 54, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-3w3axrya\overlay\Lib\site-packages\setuptools\build_meta.py", line 178, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-3w3axrya\overlay\Lib\site-packages\setuptools\build_meta.py", line 159, in _get_build_requires
      self.run_setup()
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-3w3axrya\overlay\Lib\site-packages\setuptools\build_meta.py", line 282, in run_setup
      self).run_setup(setup_script=setup_script)
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-3w3axrya\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 503, in <module>
      main()
    File "setup.py", line 36, in main
      python_lib_path = cmaker.CMaker.get_python_library(python_version).replace(
  AttributeError: 'NoneType' object has no attribute 'replace'
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE' 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\eu\AppData\Local\Temp\tmpszcszb0e' Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 22.0.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Also, i tried to run the workaround code again with the mistake fixed but it still didnt work

cgtinker commented 2 years ago

the good thing is that the wheel for setting up mediapipe was found, sadly it doesn't spin. I never had this issue so I can just guess:

You should consider upgrading via the 'python -m pip install --upgrade pip' command, so lets try that. Not sure if it makes any difference but I'd try to install the packages using the terminal:

ensure pip C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE -m ensurepip upgrade pip C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE -m pip install --upgrade pip install open-cv C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE -m pip install opencv-python install mediapipe C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE -m pip install mediapipe

In this case I'd probably also consider to clear the CMake cache. Sadly no idea about the path.. rm CMakeCache.txt

Try that before going further, there is an issue building the whl so it probably should be reported to mediapipe.

Noiet commented 2 years ago

I Did all of that except the last one (The Rm CMakeCache one) but it still didnt work, its giving me a similar error

REGISTERING BLENDARMOCAP
TRY ACCESS INSTALLED DEPENDENCIES
Dependency(module='mediapipe', package=None, name=None)
REGISTRATION FAILED: MODULE NOT FOUND
[root] DEBUG:   restart_nodes() handler
Looking for GlslTexture
accessing pip installer
pip 22.0.4 from C:\Users\eu\AppData\Roaming\Python\Python37\site-packages\pip (python 3.7)
Try to install: mediapipe 1
Collecting mediapipe
  Using cached https://files.pythonhosted.org/packages/10/90/6c9a311027fceb349afd8d1d6716dc386c6fdaa5be00de5ddcfaed82af9b/mediapipe-0.8.9.1-cp37-cp37m-win_amd64.whl
Collecting absl-py (from mediapipe)
  Using cached https://files.pythonhosted.org/packages/2c/03/e3e19d3faf430ede32e41221b294e37952e06acc96781c417ac25d4a0324/absl_py-1.0.0-py3-none-any.whl
Collecting opencv-contrib-python (from mediapipe)
  Using cached https://files.pythonhosted.org/packages/1c/c0/67ce42700579df6579864760bfa89520154e7f01b1fcbe19bf0a10dfb0de/opencv-contrib-python-4.5.5.64.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE' 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\eu\AppData\Local\Temp\tmp_z1hbmxv'
       cwd: C:\Users\eu\AppData\Local\Temp\pip-install-no4zyhb_\opencv-contrib-python
  Complete output (20 lines):
  Traceback (most recent call last):
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 207, in <module>
      main()
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 54, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-spevhg_2\overlay\Lib\site-packages\setuptools\build_meta.py", line 178, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-spevhg_2\overlay\Lib\site-packages\setuptools\build_meta.py", line 159, in _get_build_requires
      self.run_setup()
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-spevhg_2\overlay\Lib\site-packages\setuptools\build_meta.py", line 282, in run_setup
      self).run_setup(setup_script=setup_script)
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-spevhg_2\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 503, in <module>
      main()
    File "setup.py", line 36, in main
      python_lib_path = cmaker.CMaker.get_python_library(python_version).replace(
  AttributeError: 'NoneType' object has no attribute 'replace'
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE' 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\eu\AppData\Local\Temp\tmp_z1hbmxv' Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 22.0.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
INSTALL USING SUPER USER
Collecting mediapipe
  Using cached https://files.pythonhosted.org/packages/10/90/6c9a311027fceb349afd8d1d6716dc386c6fdaa5be00de5ddcfaed82af9b/mediapipe-0.8.9.1-cp37-cp37m-win_amd64.whl
Collecting opencv-contrib-python (from mediapipe)
  Using cached https://files.pythonhosted.org/packages/1c/c0/67ce42700579df6579864760bfa89520154e7f01b1fcbe19bf0a10dfb0de/opencv-contrib-python-4.5.5.64.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE' 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\eu\AppData\Local\Temp\tmpifdj1pvd'
       cwd: C:\Users\eu\AppData\Local\Temp\pip-install-y3nvfi3i\opencv-contrib-python
  Complete output (20 lines):
  Traceback (most recent call last):
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 207, in <module>
      main()
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 54, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-ykjon_bm\overlay\Lib\site-packages\setuptools\build_meta.py", line 178, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-ykjon_bm\overlay\Lib\site-packages\setuptools\build_meta.py", line 159, in _get_build_requires
      self.run_setup()
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-ykjon_bm\overlay\Lib\site-packages\setuptools\build_meta.py", line 282, in run_setup
      self).run_setup(setup_script=setup_script)
    File "C:\Users\eu\AppData\Local\Temp\pip-build-env-ykjon_bm\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 503, in <module>
      main()
    File "setup.py", line 36, in main
      python_lib_path = cmaker.CMaker.get_python_library(python_version).replace(
  AttributeError: 'NoneType' object has no attribute 'replace'
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin\python.EXE' 'C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\eu\AppData\Local\Temp\tmpifdj1pvd' Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 22.0.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Here's the logs of me executing the commands on powershell

PS C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin> python -m ensurepip
>>
Looking in links: C:\Users\eu\AppData\Local\Temp\tmp93t_neo2
Requirement already satisfied: setuptools in c:\program files\python37\lib\site-packages (39.0.1)
Requirement already satisfied: pip in c:\users\eu\appdata\roaming\python\python37\site-packages (22.0.4)
PS C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin> python -m pip install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in c:\users\eu\appdata\roaming\python\python37\site-packages (22.0.4)
PS C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin> python -m pip install opencv-python
Defaulting to user installation because normal site-packages is not writeable
Collecting opencv-python
  Downloading opencv_python-4.5.5.64-cp36-abi3-win_amd64.whl (35.4 MB)
     ---------------------------------------- 35.4/35.4 MB 3.2 MB/s eta 0:00:00
Collecting numpy>=1.14.5
  Downloading numpy-1.21.5-cp37-cp37m-win_amd64.whl (14.0 MB)
     ---------------------------------------- 14.0/14.0 MB 3.5 MB/s eta 0:00:00
Installing collected packages: numpy, opencv-python
  WARNING: The script f2py.exe is installed in 'C:\Users\eu\AppData\Roaming\Python\Python37\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.21.5 opencv-python-4.5.5.64
PS C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\bin> python -m pip install mediapipe
Defaulting to user installation because normal site-packages is not writeable
Collecting mediapipe
  Using cached mediapipe-0.8.9.1-cp37-cp37m-win_amd64.whl (48.5 MB)
Collecting opencv-contrib-python
  Downloading opencv_contrib_python-4.5.5.64-cp36-abi3-win_amd64.whl (42.2 MB)
     ---------------------------------------- 42.2/42.2 MB 3.3 MB/s eta 0:00:00
Requirement already satisfied: numpy in c:\users\eu\appdata\roaming\python\python37\site-packages (from mediapipe) (1.21.5)
Collecting protobuf>=3.11.4
  Using cached protobuf-3.20.0-cp37-cp37m-win_amd64.whl (905 kB)
Collecting attrs>=19.1.0
  Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting absl-py
  Using cached absl_py-1.0.0-py3-none-any.whl (126 kB)
Collecting matplotlib
  Using cached matplotlib-3.5.1-cp37-cp37m-win_amd64.whl (7.2 MB)
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pillow>=6.2.0
  Downloading Pillow-9.1.0-cp37-cp37m-win_amd64.whl (3.3 MB)
     ---------------------------------------- 3.3/3.3 MB 4.0 MB/s eta 0:00:00
Collecting kiwisolver>=1.0.1
  Downloading kiwisolver-1.4.2-cp37-cp37m-win_amd64.whl (54 kB)
     ---------------------------------------- 54.8/54.8 KB ? eta 0:00:00
Collecting cycler>=0.10
  Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting python-dateutil>=2.7
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ---------------------------------------- 247.7/247.7 KB 3.8 MB/s eta 0:00:00
Collecting fonttools>=4.22.0
  Downloading fonttools-4.32.0-py3-none-any.whl (900 kB)
     ---------------------------------------- 900.8/900.8 KB 4.1 MB/s eta 0:00:00
Collecting packaging>=20.0
  Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting pyparsing>=2.2.1
  Using cached pyparsing-3.0.7-py3-none-any.whl (98 kB)
Collecting typing-extensions
  Downloading typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Installing collected packages: typing-extensions, six, pyparsing, protobuf, pillow, opencv-contrib-python, fonttools, cycler, attrs, python-dateutil, packaging, kiwisolver, absl-py, matplotlib, mediapipe
  WARNING: The scripts fonttools.exe, pyftmerge.exe, pyftsubset.exe and ttx.exe are installed in 'C:\Users\eu\AppData\Roaming\Python\Python37\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed absl-py-1.0.0 attrs-21.4.0 cycler-0.11.0 fonttrm CMakeCache.txtolver-1.4.2 matplotlib-3.5.1 mediapipe-0.8.9.1 opencv-contrib-python-4.5.5.64 packaging-21.3 pillow-9.1.0 protobuf-3.20.0 pyparsing-3.0.7 python-dateutil-2.8.2 six-1.16.0 typing-extensi>> -4.1.1
Noiet commented 2 years ago

UPDATE: I reinstalled everything from blender and it seemingly started working here