python-pcl icon indicating copy to clipboard operation
python-pcl copied to clipboard

import pcl failed

Open guozhaojian opened this issue 6 years ago • 3 comments

i was used pcl1.81 in window10, python37 when import the pcl in python37 throw error:

Python37\lib\site-packages\python_pcl-0.3-py3.7-win-amd64.egg\pcl_init_.py", line 5, in from ._pcl import * ImportError: DLL load failed

but that error can not throw when i run in Powershell as Administrator what can i do

guozhaojian avatar Mar 15 '19 01:03 guozhaojian

To be short, activate the environment (if you have one), try one of the followings and see if it works:

  1. pip install openni.
  2. echo %path%, copy openni2.dll to one of the path.

ps: openni2.dll is located at your\path\to\OpenNi2\Redist or your\path\to\OpenNi2\Samples\Bin pss: Ususally 'your\path\to\' = 'C:\Program files\'

There are other issues with the same problem, and I found most of them have focused on the missing dependency 'openni2.dll', which is correct.

However, I have tried some of the mentioned solutions, none of them works. And I noticed that there were still some guys' problem not resolved. So I just put my solutions here. Wish they can help.

Let's first say that the missing dependency is exactly openni2.dll, and you have installed Openni somehow, but Python (or the virtual env) fails to find it, no matter what the reason is (if you are interested, I setup C++ PCL & openni & libfreenet for KinectV2 before python-pcl, cuz I'm really a noob to these stuff). Then let's just focus on the effort to make python find the dll.

  1. Open the terminal for python (Anaconda prompt for me), and activate the virtual environment where the python-pcl is installed (conda activate ipk, for instance), then check the path variable: echo %path% For me, the paths here are totally different from the paths in my system variables. I guess that's why copying openni2.dll to some path or adding c:....openni...\bin to system path doesn't work. So let's just copy the openni2.dll to one of the printed path, and it should work.

  2. Another possible solution: just activate the virtual environment, and try pip install openni

I guess this problem is rather stupid for those experienced, any correction or insight is welcomed.

lee2430 avatar Aug 25 '19 11:08 lee2430

@lee2430 I tried all of the above mentioned to check the path in my system variables and it seems correct to me, but I still have the same problem!

File "C:\Users\NI\Anaconda3\envs\ldr\lib\site-packages\python_pcl-0.3-py3.6-win-amd64.egg\pcl_init_.py", line 6, in from ._pcl import * ImportError: DLL load failed: The specified procedure could not be found.

what should I do now :/

lavalmsc avatar Dec 06 '20 19:12 lavalmsc

Hey, I too am having a problem with installing PCL for python. Although I have downloaded it for C++ and added its location in my environment variables. But for python, I have tried many commands over the internet but still couldn't install it. Is there a solution to this?

The same case goes for "VTK". Even though VTK is displayed when I "pip list", on importing it shows an error.

If you have a solution. I would appreciate one. Thank You

kunaltilaganji avatar Jul 05 '23 08:07 kunaltilaganji