Openpose: Problems on testing python files on Windows system

Created on 11 Nov 2019  ·  21Comments  ·  Source: CMU-Perceptual-Computing-Lab/openpose

Hi,

First of all, thanks for the great job of openpose.

By following the installation guide on Windows, I have built it successfully on Win10 system, and can run it successfully through Visual Studio 2017. But I also want to test it in python. And when I run 01 body_from_image.py (or any other python file in that file) from the path of '\openpose\build\examples\tutorial_api_python', the errors 'No module named pyopenpose' occured. I have also chose the 'build_python' in cmake and have checked the similar issues online, but could not fix it. Does anyone met similar issues and have any idea on how to solve it? I am looking forward to the reply. Many thanks in advance!

Python

Most helpful comment

I've faced this same problem, and I couldn't find a solution, hope this helps someone.
I fixed it by downgrading the python version to 3.7 (I was using python 3.8), and make sure to update the PYTHON_EXECUTABLE in CMake, to point to python 3.7 directory, and make sure to enable "BUILD_PYTHON", and on visual studio, make sure to build on "Release" mode, make sure to click "build" at the top then "build solution" because sometimes pressing the green tringle is not enough.

All 21 comments

Make sure that openpose path points to correct folder. In my case its path_to_openpose/openpose/build/python

thx a lot, I have checked the path you said, there is no any .py file in this path. Is there anything wrong?

My bad, that folder is for Linux, for windows check python/openpose/Release
I have this files there, maybe this will help with your investigation.

pyopenpose.cp37-win_amd64.pyd
pyopenpose.exp
pyopenpose.lib

In my case i just hardcoded path to this folder and it worked.

thx a lot again! I have checked and I found these files exist in 'path to
openpose\buildpython\openpose\Release'. Is this correct?

Andriy Tsvikla notifications@github.com 于2019年11月12日周二 下午7:38写道:

My bad, that folder is for Linux, for windows check python/openpose/Release
In my case i have this files there, maybe this will help with your
investigation.

pyopenpose.cp37-win_amd64.pyd
pyopenpose.exp
pyopenpose.lib


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/1427?email_source=notifications&email_token=AG62OHBHOQHSIK4T5MD7YS3QTLZZ3A5CNFSM4JLYR5Z2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOED3MUHI#issuecomment-553044509,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AG62OHHREYXVWGMU2MVAACTQTLZZ3ANCNFSM4JLYR5ZQ
.

should be.
This is quote from example.

 if platform == "win32":
            # Change these variables to point to the correct folder (Release/x64 etc.)
            sys.path.append(dir_path + '/../../python/openpose/Release');
            os.environ['PATH']  = os.environ['PATH'] + ';' + dir_path + '/../../x64/Release;' +  dir_path + '/../../bin;'
            import pyopenpose as op

basically dir_path + '/../../python/openpose/Release' this path needs to be specificed

Thank you so much! I have checked that path and made a little modification(previously the path is not in build folder), and I print them out:
C:\Users\AxIoMDev\dev_root\body_pose_estimation\openpose\examples\tutorial_api_python/../../build/python/openpose/Release C:\Users\AxIoMDev\.conda\envs\realsense-dev-caffe;C:\Users\AxIoMDev\.conda\envs\realsense-dev-caffe\Library\mingw-w64\bin;C:\Users\AxIoMDev\.conda\envs\realsense-dev-caffe\Library\usr\bin;C:\Users\AxIoMDev\.conda\envs\realsense-dev-caffe\Library\bin;C:\Users\AxIoMDev\.conda\envs\realsense-dev-caffe\Scripts;C:\Users\AxIoMDev\.conda\envs\realsense-dev-caffe\bin;C:\ProgramData\Anaconda3\condabin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\ProgramData\chocolatey\bin;C:\Users\AxIoMDev\AppData\Local\Microsoft\WindowsApps;C:\Program Files\CMake\bin;C:\Users\AxIoMDev\AppData\Local\Programs\Git\cmd;C:\Users\AxIoMDev\AppData\Local\GitHubDesktop\bin;C:\Users\AxIoMDev\dev_root\body_pose_estimation\openpose\examples\tutorial_api_python/../../build/x64/Release;C:\Users\AxIoMDev\dev_root\body_pose_estimation\openpose\examples\tutorial_api_python/../../build/bin;;C:\Users\AxIoMDev\dev_root\body_pose_estimation\openpose\examples\tutorial_api_python/../../build/x64/Release;C:\Users\AxIoMDev\dev_root\body_pose_estimation\openpose\examples\tutorial_api_python/../../build/bin; Error: OpenPose library could not be found. Did you enableBUILD_PYTHONin CMake and have this Python script in the right folder? No module named 'pyopenpose'

Could you help me find the problems through it?

And this is the part I changed:

    if platform == "win32":
        # Change these variables to point to the correct folder (Release/x64 etc.)
        sys.path.append(dir_path + '/../../build/python/openpose/Release');
        print(dir_path + '/../../build/python/openpose/Release')
        os.environ['PATH']  = os.environ['PATH'] + ';' + dir_path + '/../../build/x64/Release;' +  dir_path + '/../../build/bin;'
        print(os.environ['PATH'] + ';' + dir_path + '/../../build/x64/Release;' +  dir_path + '/../../build/bin;')
        import pyopenpose as op

Hi, I followed the tutorial and ran into the same problem (No module named 'pyopenpose') when I tried the python APIs in Win10. I checked the path, they are all good. And also I get pyopenpose.cp36-win_amd64.pyd in /python/openpose/Release. The demo runs perfectly in VS 2017.
Python 3.5.6
OpenCV 3.3.1

Hello, I followed the tutorial and same problem ... but got a:

Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the righ
DLL load failed while importing pyopenpose: The specified module could not be found.

Config:

Windows Server 2019 - Python 3 - CUDA 10 - Visual Studio 2019

This is my 01_body_from_image.py file:

if platform == "win32":
  # Change these variables to point to the correct folder (Release/x64 etc.)
  sys.path.append(dir_path + '/../../python/openpose/Release');
  os.environ['PATH']  = os.environ['PATH'] + ';' + dir_path + '/../../x64/Release;' +  dir_path + '/../../bin;'
  import pyopenpose as op

Files from command :

dir ../../python/openpose/Release/

pyopenpose.cp38-win_amd64.pyd pyopenpose.exp pyopenpose.lib

dir ../../x64/Release/

01_body_from_image_default.exe          11_asynchronous_custom_output.exe
02_whole_body_from_image_default.exe    12_asynchronous_custom_input_output_and_datum.exe
03_keypoints_from_image.exe             13_synchronous_custom_input.exe
04_keypoints_from_images.exe            14_synchronous_custom_preprocessing.exe
05_keypoints_from_images_multi_gpu.exe  15_synchronous_custom_postprocessing.exe
06_face_from_image.exe                  16_synchronous_custom_output.exe
07_hand_from_image.exe                  17_synchronous_custom_all_and_datum.exe
08_heatmaps_from_image.exe              2_thread_user_input_processing_output_and_datum.exe
09_keypoints_from_heatmaps.exe          ALL_BUILD
1_custom_post_processing.exe            Calibration.exe
1_thread_user_processing_function.exe   openpose.dll
10_asynchronous_custom_input.exe        OpenPoseDemo.exe

dir ../../bin/

boost_filesystem-vc141-mt-x64-1_69.dll  cublas64_100.dll  glog.dll            opencv_videoio_ffmpeg411_64.dll
boost_thread-vc141-mt-x64-1_69.dll      cudart64_100.dll  glogd.dll           opencv_world411.dll
caffe.dll                               cudnn64_7.dll     libgcc_s_seh-1.dll  opencv_world411d.dll
caffehdf5.dll                           curand64_100.dll  libgfortran-3.dll   VCRUNTIME140.dll
caffehdf5_hl.dll                        gflags.dll        libopenblas.dll
caffezlib1.dll                          gflagsd.dll       libquadmath-0.dll

Still have no idea...Hope someone could me help me solve this problem. Many thanks in advance!

Hey, was anyone able to solve this problem ?
If yes please share the solution cause I am facing the exact same problem as nyudeb

Edit:
The problem is not with the library but, your opencv or numpy library updated them in a new environment after reading this issue.

If the libraries are not compatible with pyopenpose, it will give the same error!

https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/1027

I have the same issue. Win10, Python 3 - CUDA 10 - Visual Studio 2019, demo works and the content of my path seems to be correct according to the others, but no module named openpose.

Hey, was anyone able to solve this problem ?
If yes please share the solution cause I am facing the exact same problem as nyudeb

Edit:
The problem is not with the library but, your opencv or numpy library updated them in a new environment after reading this issue.

If the libraries are not compatible with pyopenpose, it will give the same error!

1027

Can you explain the edit further? I don't understand.

I have the same issue. Win10, Python 3 - CUDA 10 - Visual Studio 2019, demo works and the content of my path seems to be correct according to the others, but no module named openpose.

Hey, was anyone able to solve this problem ?
If yes please share the solution cause I am facing the exact same problem as nyudeb
Edit:
The problem is not with the library but, your opencv or numpy library updated them in a new environment after reading this issue.
If the libraries are not compatible with pyopenpose, it will give the same error!

1027

Can you explain the edit further? I don't understand.

You need to build the project first(Ctrl + Shift + B)

Hi, I am also facing the exact same problem as nyudeb. I have checked all the path and got everything as nyudeb mentioned and got the same error.. So have anyone solve this problem? Thx in advance!!

I've faced this same problem, and I couldn't find a solution, hope this helps someone.
I fixed it by downgrading the python version to 3.7 (I was using python 3.8), and make sure to update the PYTHON_EXECUTABLE in CMake, to point to python 3.7 directory, and make sure to enable "BUILD_PYTHON", and on visual studio, make sure to build on "Release" mode, make sure to click "build" at the top then "build solution" because sometimes pressing the green tringle is not enough.

@ABODFTW
So did you run Openpose on Win10 using Python successfully?

Thx a lot! I changed my python version to 3.7 ,and it works!

Thx a lot! I changed my python version to 3.7 ,and it works!

Good to hear! Btw, you mean you can run Openpose successfully in Python now?

Thx a lot! I changed my python version to 3.7 ,and it works!

Good to hear! Btw, you mean you can run Openpose successfully in Python now?

Sorry just read your question, Yes, I have got OpenPose/Pyopenpose working on my Win10 machine

Thx a lot! I changed my python version to 3.7 ,and it works!

Good to hear! Btw, you mean you can run Openpose successfully in Python now?

Sorry just read your question, Yes, I have got OpenPose/Pyopenpose working on my Win10 machine

To make it work on Python 3.8 on Windows please look at

https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/1468

I had same problem, and my solution is after I cmake my openpose project, Set "example" as StartUp project in Visual Studio , then i can run the examples.

Was this page helpful?
0 / 5 - 0 ratings