Closed Eydec closed 3 years ago
Please try this code. on the script screen
import subprocess
import sys
import os
# path to python.exe
python_exe = os.path.join(sys.prefix, 'bin', 'python.exe')
# upgrade pip
subprocess.call([python_exe, "-m", "ensurepip"])
subprocess.call([python_exe, "-m", "pip", "install", "--upgrade", "pip"])
# install required packages
subprocess.call([python_exe, "-m", "pip", "install", "opencv-python"])
and click run like this :
Created a new script, c+p the code you posted, and ran. After it finished, I tried importing video via mediapipe and got the same error.
can you run again the code I provided and place here the result that shows on the console? (it must show the instalation log)
Nothing in the python console,
bpy.ops.text.run_script() In the Info console
Oh sorry, I mean this console
then something like this will show
Then you run the code again e post here the result, please
___ Looking in links: c:\Users\AppData\Local\Temp\tmp_09novfa Requirement already satisfied: setuptools in c:\users\appdata\roaming\python\python37\site-packages (39.0.1) Requirement already satisfied: pip in c:\users\appdata\roaming\python\python37\site-packages (21.0.1) Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: pip in c:\users\appdata\roaming\python\python37\site-packages (21.0.1) Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: opencv-python in c:\users\appdata\roaming\python\python37\site-packages (4.5.1.48) Requirement already satisfied: numpy>=1.14.5 in c:\program files\blender foundation\blender 2.91\2.91\python\lib\site-packages (from opencv-python) (1.17.5) ___
looks like it installed the opencv on your default windows python instalation.
Do this. on windows explorer, go to this address c:\users\appdata\roaming\python\python37\site-packages
copy the folder "cv2"
and paste it here c:\program files\blender foundation\blender 2.91\2.91\python\lib\site-packages
Tried Generate mocap, got the following error: ___ File "C:\Users\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 1405, in execute import mediapipe as mp ModuleNotFoundError: No module named 'mediapipe' ___
Now click on this button on blender, and put here what show in the console
cv2 and mediapipe aren't installed in Blender (checked through blender python console), despite mediapipe appearing in pip list -u in console.
Environment: Windows 10
Error message follows
location::-1
Python: Traceback (most recent call last):
File "C:\\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 1404, in execute
import cv2
ModuleNotFoundError: No module named 'cv2'