cgtinker / BlendArMocap

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

Unable to install dependencies in Blender V3.4.0, repeated warning every time: #111

Closed StormieFN closed 1 year ago

StormieFN commented 1 year ago

CORRUPTED DEPENDENCIES OR DEPENDENCY CONFLICTS FOUND [Dependency(module='protobuf', package=None, name='google.protobuf', pkg='protobuf'), Dependency(module='mediapipe', package=None, name='mediapipe', pkg='mediapipe')] PLEASE UNINSTALL DEPENDENCIES USING THE ADD-ON SETTINGS BlendArMocap-main - Dependencies installed: False

Do I try to manually install dependencies from online?

BenRacicot commented 1 year ago

Similar error for me on Belnder 3.5 but seems deps are missing or incorrectly versionsed somehow:

(base) ➜  MacOS sudo ./Blender
Password:
Writing userprefs: '/var/root/Library/Application Support/Blender/3.5/config/userpref.blend' ok
Info: Preferences saved

Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.5/scripts/startup/bl_operators/userpref.py", line 694, in execute
    shutil.copyfile(pyfile, path_dest)
  File "/Applications/Blender.app/Contents/Resources/3.5/python/lib/python3.10/shutil.py", line 254, in copyfile
    with open(src, 'rb') as fsrc:
IsADirectoryError: [Errno 21] Is a directory: '/Users/bracicot/dev/BlendArMocap/'
addon_utils.disable: BlendArMocap-main not disabled
Modules Installed (BlendArMocap-main) from '/Users/bracicot/Downloads/BlendArMocap-release-152.zip' into '/var/root/Library/Application Support/Blender/3.5/scripts/addons'
BlendArMocap-main - Initializing...
BlendArMocap-main - add-on path: /var/root/Library/Application Support/Blender/3.5/scripts/addons/BlendArMocap-main
BlendArMocap-main - blender bin: /Applications/Blender.app/Contents/MacOS/Blender, blender version: (3, 5, 0)
BlendArMocap-main - python exe: /Applications/Blender.app/Contents/Resources/3.5/python/bin/python3.10
Registing BlendArMocap

Try to access dependencies
The 'opencv_contrib_python' distribution was not found and is required by the application
opencv-contrib-python>=4.5.5.64 (None, None)
The 'protobuf' distribution was not found and is required by the application
protobuf>=3.11.4,<=3.20.0 (None, None)
The 'mediapipe' distribution was not found and is required by the application
mediapipe>=0.8.10 (None, None)
Attempting to install: opencv-contrib-python>=4.5.5.64
['/Applications/Blender.app/Contents/Resources/3.5/python/bin/python3.10', '-m', 'pip', 'install', '--no-cache-dir', 'opencv-contrib-python>=4.5.5.64']
Collecting opencv-contrib-python>=4.5.5.64
  Downloading opencv_contrib_python-4.7.0.68-cp37-abi3-macosx_11_0_arm64.whl (40.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.1/40.1 MB 24.7 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.17.3 in /Applications/Blender.app/Contents/Resources/3.5/python/lib/python3.10/site-packages (from opencv-contrib-python>=4.5.5.64) (1.23.5)
Installing collected packages: opencv-contrib-python
ERROR: Could not install packages due to an OSError: [Errno 1] Operation not permitted: '/Applications/Blender.app/Contents/Resources/3.5/python/lib/python3.10/site-packages/cv2'

Cannot install opencv-contrib-python>=4.5.5.64.
Attempting to install: protobuf>=3.11.4,<=3.20.0
['/Applications/Blender.app/Contents/Resources/3.5/python/bin/python3.10', '-m', 'pip', 'install', '--no-cache-dir', 'protobuf>=3.11.4,<=3.20.0']
Collecting protobuf<=3.20.0,>=3.11.4
  Downloading protobuf-3.20.0-cp310-cp310-macosx_10_9_universal2.whl (962 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 962.3/962.3 kB 14.1 MB/s eta 0:00:00
Installing collected packages: protobuf
ERROR: Could not install packages due to an OSError: [Errno 1] Operation not permitted: '/Applications/Blender.app/Contents/Resources/3.5/python/lib/python3.10/site-packages/protobuf-3.20.0-py3.10-nspkg.pth'

Cannot install protobuf>=3.11.4,<=3.20.0.
Attempting to install: mediapipe>=0.8.10
['/Applications/Blender.app/Contents/Resources/3.5/python/bin/python3.10', '-m', 'pip', 'install', '--no-cache-dir', 'mediapipe>=0.8.10']
ERROR: Could not find a version that satisfies the requirement mediapipe>=0.8.10 (from versions: none)
ERROR: No matching distribution found for mediapipe>=0.8.10
Cannot install mediapipe>=0.8.10.
BlendArMocap-main - Initializing...
BlendArMocap-main - blender bin: /Applications/Blender.app/Contents/MacOS/Blender, blender version: (3, 5, 0)
BlendArMocap-main - python exe: /Applications/Blender.app/Contents/Resources/3.5/python/bin/python3.10
BlendArMocap-main - Dependencies installed: False
zumerzal commented 1 year ago

I am having a similar issue, but it says to check if my CV2 is corrupted, is anyone else having this issue?

PLEASE CHECK IF CV2 IS CORRUPTED cannot import name 'python' from 'mediapipe.tasks.python' (C:\Program Files\Blender Foundation\Blender 3.4\3.4\python\lib\site-packages\mediapipe\tasks\python__init__.py) CORRUPTED DEPENDENCIES OR DEPENDENCY CONFLICTS FOUND [Dependency(module='protobuf', package=None, name='google.protobuf', pkg='protobuf'), Dependency(module='mediapipe', package=None, name='mediapipe', pkg='mediapipe')] PLEASE UNINSTALL DEPENDENCIES USING THE ADD-ON SETTINGS BlendArMocap-main - Dependencies installed: False

cgtinker commented 1 year ago

I've rewrote the dependency setup to not require admin rights and to be explicit for all underlying packages. Just pushed it to the main - it's an major update which I'm still testing before I call it an official release but you might want to give it a go. No idea if it might conflict with underlying packages if you try to install the dependencies within the version you've had conflicts but I hope you'll have a better experience ;)

StormieFN commented 1 year ago

Thx, already fixed though and am using it. I am struggling to use the driver with transferring fbx data to my armature, especially as is a rig from UE5 and pre-made as a game character, so I’m MoCapping a game character for easy thumbnail render pose.

KaijuKoder commented 1 year ago

Back after a break. @zumerzal, got the same error when I tried to use and even reinstall BlendArMocap 1.5.2. Seems not to work in Blender 3.4 at least for me.

mediapipe>=0.8.10 installed successfully. BlendArMocap-main - Initializing... BlendArMocap-main - blender bin: C:\Program Files\Blender Foundation\Blender 3.4\blender.exe, blender version: (3, 4, 1) BlendArMocap-main - python exe: C:\Program Files\Blender Foundation\Blender 3.4\3.4\python\bin\python.exe (Dependency(module='opencv-contrib-python>=4.5.5.64', package=None, name='cv2', pkg='opencv_contrib_python'), Dependency(module='protobuf>=3.11.4,<=3.20.0', package=None, name='google.protobuf', pkg='protobuf'), Dependency(module='mediapipe>=0.8.10', package=None, name='mediapipe', pkg='mediapipe')) (Dependency(module='opencv-contrib-python>=4.5.5.64', package=None, name='cv2', pkg='opencv_contrib_python'), Dependency(module='protobuf>=3.11.4,<=3.20.0', package=None, name='google.protobuf', pkg='protobuf'), Dependency(module='mediapipe>=0.8.10', package=None, name='mediapipe', pkg='mediapipe')) (Dependency(module='opencv-contrib-python>=4.5.5.64', package=None, name='cv2', pkg='opencv_contrib_python'), Dependency(module='protobuf>=3.11.4,<=3.20.0', package=None, name='google.protobuf', pkg='protobuf'), Dependency(module='mediapipe>=0.8.10', package=None, name='mediapipe', pkg='mediapipe')) PLEASE CHECK IF CV2 IS CORRUPTED cannot import name 'python' from 'mediapipe.tasks.python' (C:\Program Files\Blender Foundation\Blender 3.4\3.4\python\lib\site-packages\mediapipe\tasks\python\__init__.py) CORRUPTED DEPENDENCIES OR DEPENDENCY CONFLICTS FOUND [Dependency(module='protobuf', package=None, name='google.protobuf', pkg='protobuf'), Dependency(module='mediapipe', package=None, name='mediapipe', pkg='mediapipe')] PLEASE UNINSTALL DEPENDENCIES USING THE ADD-ON SETTINGS BlendArMocap-main - Dependencies installed: False

but cv2 seems fine - not corrupt. I can interact with it from the console fine. Using Blender 3.4.1 (which has Python 3.10.8 built in). Solution was to install 1.5.2 first, set the dependencies in preferences there (make sure you PYTHONPATHS system environment variable isn't giving you problems), and then install and run 1.6.0. Can't run 1.6.0 immediately since AFAICT you can't install the dependencies from its Addon panel, only from 1.5.2.

That done, is working.

cgtinker commented 1 year ago

Hm thanks for the info. I'll revisit this.

KaijuKoder commented 1 year ago

@cgtinker, I've been continuing to test 1.6.0. Once I got past the problem installing the dependencies, it's been working very well.

Spent most time looking at face transfers are very promising. On my model at least the mouth shapes could be a little better (open-close mouth is good, but mouth doesn't narrow). It would be good if we could somehow "bake" the constraints so we end up with normal keyframes we can then go in and tweak them.

Also briefly looked at hands and pose. Both seem okay, though pose suffers from the problem mediapipe looks great in 2D but when converted to 3D things the posture gets weird. Have you considered multiple cameras for 3D in a later release?

I've been looking at all the mocap solutions available. All have their limitations. BlendArMocap is looking very promising.

cgtinker commented 1 year ago

Glad it's running! What did you change?

Checkout freemocap for multicam tracking - in 1.6.0 is an import option for freemocap data. Also check out my repro 'rigify gamerig extension' to bake anims easily to the metarig. Gonna make some tutorials in the future. If U want to discuss further probably join me on discord or open a new issue as this one is mainly for dependency installation problems:)

KaijuKoder commented 1 year ago

Glad it's running! What did you change?

Confusion about the different versions of python on my PC. Found the one being used by Blender via import sys; sys.path in the Scripting Window. Went there C:\Program Files\Blender Foundation\Blender 3.4\3.4\python\bin with the Windows command prompt, installed using .\python -m pip ..., and that seemed to work.

Curious, why would you want to animate a metarig, since AFAIK it's only used to create the actual rig? I'd like to animate the actual rig, since I can clean / tweak the animation there. That said it's good to at least detect it even if it report the error.

Have checked out Freemocap. Will check it out some more, but so far found the animations it produces are rudimentary. The developer warns it is alpha and needs more work.

cgtinker commented 1 year ago

Please refer to #131 if you have further dependency issues on windows