cgtinker / BlendArMocap

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

Blender 3.2 error upon installing dependencies #59

Closed MetalMantis closed 1 year ago

MetalMantis commented 2 years ago

upon installing dependencies, blender 3.2 returns

Python: Traceback (most recent call last):
  File "C:\Users\Ian\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlendArMocap-release\src\cgt_blender\interface\pref_operators.py", line 56, in execute
    cgt_imports.manage_imports(reload=True)
  File "C:\Users\Ian\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlendArMocap-release\src\cgt_imports.py", line 98, in manage_imports
    reload_module(module)
  File "C:\Users\Ian\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlendArMocap-release\src\cgt_imports.py", line 57, in reload_module
    importlib.reload(sys.modules[f"{PACKAGE_NAME}{module}"])
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.2\python\lib\importlib\__init__.py", line 169, in reload
    _bootstrap._exec(spec, module)
  File "<frozen importlib._bootstrap>", line 619, in _exec
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\Ian\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlendArMocap-release\src\cgt_blender\utils\dependencies.py", line 337, in <module>
    import_module(dependency)
  File "C:\Users\Ian\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\BlendArMocap-release\src\cgt_blender\utils\dependencies.py", line 75, in import_module
    importlib.reload(globals()[tmp_dependency.name])
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.2\python\lib\importlib\__init__.py", line 169, in reload
    _bootstrap._exec(spec, module)
  File "<frozen importlib._bootstrap>", line 619, in _exec
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.2\python\lib\site-packages\cv2\__init__.py", line 8, in <module>
    from .cv2 import *
ImportError: Bindings generation error. Submodule name should always start with a parent module name. Parent name: cv2.cv2. Submodule name: cv2
zkun7486 commented 2 years ago

Hello, I also encountered the same problem, have you solved it? thank you.

MetalMantis commented 2 years ago

Hello, I also encountered the same problem, have you solved it? thank you.

looking into it now

zkun7486 commented 2 years ago

Looks like the problem is here?

Submodule name should always start with a parent module name. Parent name: cv2.cv2. Submodule name: cv2

I'm not very knowledgeable about code and I'm still looking for a solution until now. But there is almost no answer to this question, which confuses me a lot.

zkun7486 commented 2 years ago

When I saw the problem was that my blender version was 3.1, at which point it wasn't working, and when I upgraded to 3.2 it was briefly available for a while until I restarted blender and it wasn't available again.

MetalMantis commented 2 years ago

yeah, thats the problem, I think cv2 might come bundled with blenders python already, thats my guess. There is probably and import statement somewhere that I need to remove. I'm really rusty with python but the hunt is on

zkun7486 commented 2 years ago

I'm going to try now to see if installing an older version of blender makes it work again, like 2.9

imgabrielbenites commented 2 years ago

I have the same problem

cgtinker commented 2 years ago

I mainly focus on LTS version, I didn't look into version 3.2 yet. Maybe I will only support LTS versions in the future as Blender changes their python versions constantly which causes a lot of issues when tools depend on external dependencies.

  1. when reproducing the issue, just a restart of blender solved the issue for me - can anyone confirm this?
  2. can you try setting up the add-on using a LTS version preferably 2.93
  3. cv2 seems not to be packed in v3.2

When I saw the problem was that my blender version was 3.1, at which point it wasn't working, and when I upgraded to 3.2 it was briefly available for a while until I restarted blender and it wasn't available again.

I didn't really understand and require some more informations about that. Which operating system are you using? What exactly wasn't working - installing the dependencies or running the detection?

ed: I'll try to reproduce this issue in other blender versions. My current guess is, that blender changed their importlib. My current system does only import the required scripts to install the dependencies, as soon their are installed, I'm importing and reloading all scripts to run the add-on. It seems like cv2 does reload when initialising which results in the error - maybe anything isn't cached until blender restarted? Not sure.

zkun7486 commented 2 years ago

我主要关注LTS版本,我还没有研究3.2版本。也许我将来只会支持 LTS 版本,因为 Blender 会不断更改他们的 python 版本,当工具依赖于外部依赖时会导致很多问题。

  1. 重现问题时,只需重新启动搅拌机即可为我解决问题 - 任何人都可以确认这一点吗?
  2. 您可以尝试使用 LTS 版本(最好是 2.93)设置插件吗
  3. cv2 似乎没有包含在 v3.2 中

当我看到问题是我的搅拌机版本是 3.1 时,它无法正常工作,当我升级到 3.2 时,它短暂可用一段时间,直到我重新启动搅拌机并且它不再可用。

我并不真正了解并需要有关此的更多信息。您使用的是哪个操作系统?究竟是什么不起作用 - 安装依赖项或运行检测?

My computer is win11, and this error was reported when I used blender 3.1. I tried to upgrade to 3.2 and reinstalled the dependency library. It was temporarily available and appeared in the menu on the right, but when I reopened blender 3 .2 the plugin disappeared from the right menu, (the plugin is ticked in the preferences at this time) and then I tried to reopen the plugin and the error was reported again。

zkun7486 commented 2 years ago

image

zkun7486 commented 2 years ago

I have tried to install the dependent library in blender2.93, I will report the result to you later, thank you

cgtinker commented 2 years ago

I have tried to install the dependent library in blender2.93, I will report the result to you later, thank you

aight great, will try to reproduce this soon. I'll add a hint that using other versions than LTS versions is experimental, otherwise it gets too hard to maintain as individual.

zkun7486 commented 2 years ago

The same problem, when I installed the dependency library in blender2.93, it is available, but it is not available again after closing blender

zkun7486 commented 2 years ago

However, I noticed a prompt in the plugin window after installing the dependency library, and I went to the console to record it

zkun7486 commented 2 years ago

Prompt after installing dependent librarie 屏幕截图 2022-06-09 214202 s

zkun7486 commented 2 years ago

The plugin can be used in this time 屏幕截图 2022-06-09 213946

zkun7486 commented 2 years ago

and now image

cgtinker commented 2 years ago

Thanks for all the infos, have to investigate this.

Does the error only occur when opening the settings? Or upon starting blender when the add-on is enabled? Also, when the add-on is enabled and dependencies are installed, can you run the add-on functions (like stream detection) while there is the error present?

zkun7486 commented 2 years ago

When an error occurs, the plug-in is gray and cannot be enabled. If it is enabled (checked), an error will be reported, and the plug-in will not be displayed in the right menu.

zkun7486 commented 2 years ago

In short, on this device of mine, it can only be used for a short time by reinstalling blender and enabling the plugin for the first time and installing the dependency library. After that, closing the software plugin will invalidate and can no longer be enabled.

cgtinker commented 2 years ago

was able to reproduce the issue and think it should work now - can you download blendarmocap from either the development or the main branch and give it a try? If you are using windows blender will shut down when enabling the add-on to do a proper clean-up. Let me know!

imgabrielbenites commented 2 years ago

image

when enabling the Addon in Blender 3.2 the error continues

cgtinker commented 2 years ago

did you start as admin? also, did you pull from main? forgot to push to development .. can you send me the full log?

ed: just pushed to dev branch

imgabrielbenites commented 2 years ago

image

yes installed main. yes run as administrator!

cgtinker commented 2 years ago

image

yes installed main. yes run as administrator!

weird there are some prints missing. I've added some more exceptions and prints to hopefully fetch it. can you get the version from the development branch?

cgtinker commented 2 years ago

https://github.com/cgtinker/BlendArMocap/tree/development press the green "code" button (top right) and choose "download zip"

ed: no matter if it runs or not, please send me the entire print. ed2: actually I can also throw it in here :octocat: BlendArMocap-development-3.zip

imgabrielbenites commented 2 years ago

I downloaded this link that you gave me above and it continues

image

EDIT: Blender Version 3.2

cgtinker commented 2 years ago

actually that's a new error so that's good. can you restart blender and send me the console message (not an image of the bug) - window > toggle system console

imgabrielbenites commented 2 years ago

image

cgtinker commented 2 years ago

ok seems we successfully uninstalled the dependency which causes issues but still loading in after it. guess now it's fixed?

BlendArMocap-development-4.zip

imgabrielbenites commented 2 years ago

genius!!! It worked! thank you so much!

image

cgtinker commented 2 years ago

thanks a lot for your patience, glad it works now! =)

zkun7486 commented 2 years ago

ok seems we successfully uninstalled the dependency which causes issues but still loading in after it. guess now it's fixed?

BlendArMocap-development-4.zip

I am glad to see that other people's problems have been solved. When I download this, although it can be checked, the plug-in page does not display the other three dependent libraries, and there is no download button. image

cgtinker commented 2 years ago

I am glad to see that other people's problems have been solved. When I download this, although it can be checked, the plug-in page does not display the other three dependent libraries, and there is no download button.

Can you toggle your system console, reproduce the issue and send me the entire print please?

KaijuKoder commented 2 years ago

Had a difficult install which took many hours, but finally got it working. I'll post this solution anyway in case it helps others. The ultimate fix is add C:\Users\YOURNAMEHERE\AppData\Roaming\Python\Python310\site-packages to PYTHONPATH in your system environment variables. Thank you to the author of this web page https://ameblo.jp/sijukara-tama/entry-12719459520.html (use Google translate)

@cgtinker, You might consider adding a check for this since the BlendarMocap dependency checker code dependencies.py importlib.util.find_spec() doesn't detect the problem properly. I think that importlib looks in sys.modules and assumes because it can't find mediapipe there it reports that module has not yet been installed (see screenshot), even though it is there (as pip list shows) and the error is something else (cv2).

blendarmocap-addon-panel


Original Issue report here:

Having many issues here trying to install BlendarMocap 1.5.2 in Blender 3.2. Also tried a clean portable install of Blender but same problem:

After add dependencies, the BlendarMocap addon can't seem to detect mediapipe, even when it seems to be there and even though it detects the other dependencies fine.

Restarting Blender prints this on console:

Registing BlendArMocap Try to access dependencies opencv-python==4.5.5.64 ('4.5.5.64', 'c:\test\blender-3.2.0-windows-x64\3.2\python\lib\site-packages\opencv-python') protobuf==3.19.1 ('3.19.1', 'c:\test\blender-3.2.0-windows-x64\3.2\python\lib\site-packages\protobuf') The 'mediapipe' distribution was not found and is required by the application mediapipe==0.8.10 (None, None) Saved session recovery to 'c:\tmp\quit.blend' Unregister BlendArMocap

View 3D | Tool | BlendarMocap panel message stays as "Please install the mising dependencies..." even after you reinstall dependencies.

It is there though:

c:\test\blender-3.2.0-windows-x64>3.2\python\bin\python.exe -m pip list ... mediapipe 0.8.10 numpy 1.22.0 opencv-contrib-python 4.6.0.66 opencv-python 4.5.5.64 ... pip 22.1.2 protobuf 4.21.1

There is a strange message embedded in the console output when running BlendarMocap install dependencies (similar message when run from Program Files\Blender Foundation install too)

... Installing collected packages: opencv-contrib-python, attrs, absl-py, matplotlib, mediapipe ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\test\blender-3.2.0-windows-x64\3.2\python\Lib\site-packages\cv2\cv2.pyd' Consider using the --user option or check the permissions. ...

These didn't help: https://stackoverflow.com/questions/54820174/could-not-install-open-cv-due-to-an-environmenterror-winerror-5-access-is-den

The fix everyone suggests python -m pip install opencv-contrib-python runs fine but makes no difference.

Though did see importing both mediapipe and cv2 in python result in this same error:

import cv2 Traceback (most recent call last): File "", line 1, in File "c:\test\blender-3.2.0-windows-x64\3.2\python\lib\site-packages\cv2__init.py", line 181, in bootstrap() File "c:\test\blender-3.2.0-windows-x64\3.2\python\lib\site-packages\cv2\init.py", line 153, in bootstrap native_module = importlib.import_module("cv2") File "c:\test\blender-3.2.0-windows-x64\3.2\python\lib\importlib\init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: DLL load failed while importing cv2: The specified module could not be found. import mediapipe Traceback (most recent call last): File "", line 1, in File "C:\Users\guest\AppData\Roaming\Python\Python310\site-packages\mediapipe\init.py", line 17, in import mediapipe.python.solutions as solutions File "C:\Users\guest\AppData\Roaming\Python\Python310\site-packages\mediapipe\python\solutions\init__.py", line 17, in import mediapipe.python.solutions.drawing_styles File "C:\Users\guest\AppData\Roaming\Python\Python310\site-packages\mediapipe\python\solutions\drawing_styles.py", line 20, in from mediapipe.python.solutions.drawing_utils import DrawingSpec File "C:\Users\guest\AppData\Roaming\Python\Python310\site-packages\mediapipe\python\solutions\drawing_utils.py", line 20, in import cv2 ImportError: DLL load failed while importing cv2: The specified module could not be found.

Ultimate solution: The ultimate fix is add C:\Users\YOURNAMEHERE\AppData\Roaming\Python\Python310\site-packages to PYTHONPATH in your system environment variables. Thank you to the author of this web page https://ameblo.jp/sijukara-tama/entry-12719459520.html (use Google translate)

rong2416 commented 2 years ago

@KaijuKoder blender 3.1.2 python3.10 Problem resolved

KaijuKoder commented 2 years ago

In follow up to yesterday's post:

Tested the installation right through and confirm it's working brilliantly. An amazing package, @cgtinker. I work with another video mocap package, but once past the dependencies yours was amazingly easy to use and the results were very good out-of-the-box. I like conventional animation but this was so fast! It has a lot of potential.

A few ideas (none of these are showstoppers, but instead something to think about (should I raise these as separate issues???)):

Anyway @cgtinker. An amazing package. The best I've seen.

cgtinker commented 2 years ago

In follow up to yesterday's post:

Tested the installation right through and confirm it's working brilliantly. An amazing package, @cgtinker. I work with another video mocap package, but once past the dependencies yours was amazingly easy to use and the results were very good out-of-the-box. I like conventional animation but this was so fast! It has a lot of potential.

A few ideas (none of these are showstoppers, but instead something to think about (should I raise these as separate issues???)):

  • Most artists rig meshes with the mouth slightly open, but the script seems to assume it's rigged closed, so mouth movements are exaggerated, so when it should be closed it's already open, and when it's open it's comically huge.

  • Some issues linking to library meshes with overrides (you can't EDIT mode a library mesh, though you can POSE mode it). Workaround is to make a copy of the mesh, but that can be huge and not viable for multiple shots.

  • Think the script uses drivers? Would be good to be able to convert that into conventional keyframes for tweaking (and might fix the library override problem since applying keyframes to an overridden library object is easy).

  • Perhaps averaging points to prevent jittering.

Anyway @cgtinker. An amazing package. The best I've seen.

Hey thanks, glad U got it running. :) I'll do more tests regarding this issue soon. Thanks a lot for the link! :) There are already some workarounds for your suggestions:

  1. I've added custom properties to quiet a bunch of bones, there is a list in the readme. Those props allow to change the slope of the driver(s) (b.e. max up, max down movement of the mouth). To adjust the custom props navigate to pose mode > bone > custom properties.

2/3. You can bake the animation of a rig and also convert drivers/constraints while doing so. Then the anim gets stored as action which U can stash as nla clip. Both of which can be edited and transferred properly.

  1. I kind of want to preserve the raw data as it delivers the most control. Using blenders smooth keys usually ends up in decent results. Also, Mediapipe is still not in release state which may introduce quite a bunch of changes, will see :)

If U have issues or further suggestions please create a separate issue :)

cgtinker commented 2 years ago

Ultimate solution: The ultimate fix is add C:\Users\YOURNAMEHERE\AppData\Roaming\Python\Python310\site-packages to PYTHONPATH in your system environment variables. Thank you to the author of this web page https://ameblo.jp/sijukara-tama/entry-12719459520.html (use Google translate)

checked your link, while it may fixes issues for some, I've implemented another solution now. While adding the users site packages to blenders sys.path works, blender stopped supporting it in v.2.79 (if I remember correctly) and therefore might introduces other issues.

I've reworked the dependency management. While uninstalling dependencies still can cause issues, the setup it self should now be more stable, shouldn't cause OsErrors and shouldn't require the "--user" tag anymore. It's up on my development branch, after some more testing I'll release it in v.1.5.2

Chinh24112001 commented 2 years ago

image i have this error. Can you tell me how to fix it?

Chinh24112001 commented 2 years ago

I'm using Win 11

Iansamit commented 2 years ago

I'm still unable to get the downloads. My OS is OpenSuse 15.3, and I have Blender installed from Snap. I tried both the Development and Main release plugins, but get the following error (via console):

Traceback (most recent call last): File "/snap/blender/2578/3.2/scripts/modules/addon_utils.py", line 335, in enable mod = __import__(module_name) File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-main/__init__.py", line 40, in <module> reload_modules() File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-main/__init__.py", line 36, in reload_modules cgt_imports.manage_imports() File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-main/src/cgt_imports.py", line 84, in manage_imports import_module(module) File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-main/src/cgt_imports.py", line 51, in import_module importlib.import_module(f"{PACKAGE_NAME}{module}") File "/snap/blender/2578/3.2/python/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-main/src/cgt_blender/interface/ui_registration.py", line 22, in <module> from . import ui_properties, ui_panels, pref_operators, pref_panels, ui_operators File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-main/src/cgt_blender/interface/ui_panels.py", line 21, in <module> from . import pref_operators File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-main/src/cgt_blender/interface/pref_operators.py", line 24, in <module> from ..utils import dependencies File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-main/src/cgt_blender/utils/dependencies.py", line 409, in <module> for is_installed, corrupted_dependency in analyze_dependencies(required_dependencies): File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-main/src/cgt_blender/utils/dependencies.py", line 356, in analyze_dependencies if not is_package_installed(_dependency): File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-main/src/cgt_blender/utils/dependencies.py", line 116, in is_package_installed package = importlib.util.find_spec(_dependency.name) AttributeError: module 'importlib' has no attribute 'util'

Iansamit commented 2 years ago

Sorry I just noticed this when I tried again:

Try to access dependencies REGISTRATION FAILED: REQUIRED MODULE NOT FOUND Attempting to install pip. Defaulting to user installation because normal site-packages is not writeable Looking in links: /tmp/tmppkfhmqgn Requirement already satisfied: setuptools in /root/.local/lib/python3.10/site-packages (58.1.0) Requirement already satisfied: pip in /root/.local/lib/python3.10/site-packages (21.2.4) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv Attempting to install: opencv-python==4.5.5.64 ['/snap/blender/2578/3.2/python/bin/python3.10', '-m', 'pip', 'install', '--no-cache-dir', 'opencv-python==4.5.5.64'] /snap/blender/2578/3.2/python/bin/python3.10: No module named pip ['/snap/blender/2578/3.2/python/bin/python3.10', '-m', 'pip', 'install', '--no-cache-dir', 'opencv-python==4.5.5.64', '--user'] Requirement already satisfied: opencv-python==4.5.5.64 in /root/.local/lib/python3.10/site-packages (4.5.5.64) Requirement already satisfied: numpy>=1.21.2 in /root/.local/lib/python3.10/site-packages (from opencv-python==4.5.5.64) (1.23.0) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv WARNING: You are using pip version 21.2.4; however, version 22.1.2 is available. You should consider upgrading via the '/snap/blender/2578/3.2/python/bin/python3.10 -m pip install --upgrade pip' command. opencv-python==4.5.5.64 installed successfully. trying to load Dependency(module='opencv-python==4.5.5.64', package='opencv-python==4.5.5.64', name='cv2', pkg='opencv_python') No module named 'cv2' Attempting to install: protobuf==3.19.1 ['/snap/blender/2578/3.2/python/bin/python3.10', '-m', 'pip', 'install', '--no-cache-dir', 'protobuf==3.19.1'] /snap/blender/2578/3.2/python/bin/python3.10: No module named pip ['/snap/blender/2578/3.2/python/bin/python3.10', '-m', 'pip', 'install', '--no-cache-dir', 'protobuf==3.19.1', '--user'] Requirement already satisfied: protobuf==3.19.1 in /root/.local/lib/python3.10/site-packages (3.19.1) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv WARNING: You are using pip version 21.2.4; however, version 22.1.2 is available. You should consider upgrading via the '/snap/blender/2578/3.2/python/bin/python3.10 -m pip install --upgrade pip' command. protobuf==3.19.1 installed successfully. trying to load Dependency(module='protobuf==3.19.1', package='protobuf==3.19.1', name='google.protobuf', pkg='protobuf') No module named 'google' Attempting to install: mediapipe==0.8.10 ['/snap/blender/2578/3.2/python/bin/python3.10', '-m', 'pip', 'install', '--no-cache-dir', 'mediapipe==0.8.10'] /snap/blender/2578/3.2/python/bin/python3.10: No module named pip ['/snap/blender/2578/3.2/python/bin/python3.10', '-m', 'pip', 'install', '--no-cache-dir', 'mediapipe==0.8.10', '--user'] Requirement already satisfied: mediapipe==0.8.10 in /root/.local/lib/python3.10/site-packages (0.8.10) Requirement already satisfied: numpy in /root/.local/lib/python3.10/site-packages (from mediapipe==0.8.10) (1.23.0) Requirement already satisfied: absl-py in /root/.local/lib/python3.10/site-packages (from mediapipe==0.8.10) (1.1.0) Requirement already satisfied: attrs>=19.1.0 in /root/.local/lib/python3.10/site-packages (from mediapipe==0.8.10) (21.4.0) Requirement already satisfied: protobuf>=3.11.4 in /root/.local/lib/python3.10/site-packages (from mediapipe==0.8.10) (3.19.1) Requirement already satisfied: matplotlib in /root/.local/lib/python3.10/site-packages (from mediapipe==0.8.10) (3.5.2) Requirement already satisfied: opencv-contrib-python in /root/.local/lib/python3.10/site-packages (from mediapipe==0.8.10) (4.6.0.66) Requirement already satisfied: python-dateutil>=2.7 in /root/.local/lib/python3.10/site-packages (from matplotlib->mediapipe==0.8.10) (2.8.2) Requirement already satisfied: fonttools>=4.22.0 in /root/.local/lib/python3.10/site-packages (from matplotlib->mediapipe==0.8.10) (4.34.2) Requirement already satisfied: pillow>=6.2.0 in /root/.local/lib/python3.10/site-packages (from matplotlib->mediapipe==0.8.10) (9.2.0) Requirement already satisfied: kiwisolver>=1.0.1 in /root/.local/lib/python3.10/site-packages (from matplotlib->mediapipe==0.8.10) (1.4.3) Requirement already satisfied: cycler>=0.10 in /root/.local/lib/python3.10/site-packages (from matplotlib->mediapipe==0.8.10) (0.11.0) Requirement already satisfied: packaging>=20.0 in /root/.local/lib/python3.10/site-packages (from matplotlib->mediapipe==0.8.10) (21.3) Requirement already satisfied: pyparsing>=2.2.1 in /root/.local/lib/python3.10/site-packages (from matplotlib->mediapipe==0.8.10) (3.0.9) Requirement already satisfied: six>=1.5 in /root/.local/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib->mediapipe==0.8.10) (1.16.0) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv WARNING: You are using pip version 21.2.4; however, version 22.1.2 is available. You should consider upgrading via the '/snap/blender/2578/3.2/python/bin/python3.10 -m pip install --upgrade pip' command. mediapipe==0.8.10 installed successfully. trying to load Dependency(module='mediapipe==0.8.10', package='mediapipe==0.8.10', name='mediapipe', pkg='mediapipe') No module named 'mediapipe' BlendArMocap-development - Initializing... BlendArMocap-development - Dependencies installed: True BlendArMocap-development - Attempt to reload... BlendArMocap-development - blender bin: /snap/blender/2578/blender, blender version: (3, 2, 1) BlendArMocap-development - python exe: /snap/blender/2578/3.2/python/bin/python3.10 trying to load Dependency(module='opencv-python==4.5.5.64', package='opencv-python==4.5.5.64', name='cv2', pkg='opencv_python') No module named 'cv2' Traceback (most recent call last): File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-development/src/cgt_blender/interface/pref_operators.py", line 56, in execute cgt_imports.manage_imports(reload=True) File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-development/src/cgt_imports.py", line 97, in manage_imports import_module(module) File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-development/src/cgt_imports.py", line 52, in import_module importlib.import_module(f"{PACKAGE_NAME}{module}") File "/snap/blender/2578/3.2/python/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-development/src/cgt_detection/detect_face.py", line 18, in <module> import mediapipe as mp ModuleNotFoundError: No module named 'mediapipe' Error: Python: Traceback (most recent call last): File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-development/src/cgt_blender/interface/pref_operators.py", line 56, in execute cgt_imports.manage_imports(reload=True) File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-development/src/cgt_imports.py", line 97, in manage_imports import_module(module) File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-development/src/cgt_imports.py", line 52, in import_module importlib.import_module(f"{PACKAGE_NAME}{module}") File "/snap/blender/2578/3.2/python/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/root/.config/blender/3.2/scripts/addons/BlendArMocap-development/src/cgt_detection/detect_face.py", line 18, in <module> import mediapipe as mp ModuleNotFoundError: No module named 'mediapipe'

cgtinker commented 2 years ago

Sorry I just noticed this when I tried again

Can you check if blenders LTS (v2.93) works for U? Not sure if mediapipe supports python 3.10.. doubt it

Iansamit commented 2 years ago

Hi CG, I finally managed to get it working today - the problem was not mediapipe but Pip, which is not installed in the snap version of Blender. For anyone else with a similar problem, this is what eventually worked for me:

  1. Uninstall the snap version of Blender and replace it with the stand-alone version available from Blender downloads.
  2. This version also does not include Pip, but it's easier to modify since it's directory structure is owned by the user. (I tried unsuccessfully to get Pip installed in snap Blender but couldn't modify the directories, even as root.)
  3. Locate the system python site-packages directory - for me it's usr/lib/python3.6/
  4. Make sure it contains Pip - otherwise install it using your regular system tool.
  5. Locate the Blender python site-packages directly - for me path/to/blender/3.2/python/lib/python3.10/
  6. Just in case, rename the Blender site-packages directory to something like site-packages_old
  7. Copy the site-packages directory from the system python to the Blender python location.
  8. While still logged in as root, recursively change the permissions of the copied site-packages, its sub-directories and files.
  9. Start Blender, re-install BlendArMocap, and you should now see Pip listed as installed.

By the way, one other advantage of using the stand-alone version of Blender is that you can use BlendArMocap with a webcam as a normal user.

Iansamit commented 2 years ago

Further to my previous post, I forgot to go through the old site-packages directory, and found that at least one of my plugins had stopped working! So, I copied all missing packages back into the new site-packages directory.

In fact, the original problem could probably have been solved simply by copying Pip into Blender python site-packages.

cgtinker commented 1 year ago

Lots of those issues are fixed by now, however, issues still may occur in the new version. I'll create an official release next week, you can try it already by testing the current main branch. (I'll just fix some minor things). The goal for the future is to create a separate executable to bypass the requirement of dependencies in blender. If you want to support to do so, checkout #128. If you have further installation issues, please refer to the topic created for them.

129 Linux Issues

130 MacOS Issues

131 Windows Issues