strawlab / python-pcl

Python bindings to the pointcloud library (pcl)
http://strawlab.github.com/python-pcl/
Other
2.01k stars 700 forks source link

error when import pcl #50

Open panjia1983 opened 10 years ago

panjia1983 commented 10 years ago

I installed the python-pcl, but when I import that, I have the following error: /usr/local/lib/python2.7/dist-packages/pcl/_pcl.so: undefined symbol: _ZN3pcl7PCLBaseINS_8PointXYZEE10setIndicesERKN5boost10shared_ptrISt6vectorIiSaIiEEEE

I am on ubuntu 12.04, python 2.7, pcl 1.7

nzjrs commented 10 years ago

More information needed.

What vesion of cython? How did you install pcl? What version of python-pcl? Did you build this in a virtualenv?

larsmans commented 10 years ago

Not a venv, judging from the /usr/local. What does

ldd /usr/local/lib/python2.7/dist-packages/pcl/_pcl.so | grep libpcl

report?

rickarmstrong commented 9 years ago

Same issue here, Mint 17, Python 2.7, pcl 1.7, as soon as I say import pcl I get Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/pcl/init.py", line 2, in from ._pcl import * ImportError: /usr/local/lib/python2.7/dist-packages/pcl/_pcl.so: undefined symbol: _ZN3pcl6search6KdTreeINS_8PointXYZEEC1Eb

Also, if I do 'import pcl' from within ipython, I get the same error, but with slightly more information:

ImportError Traceback (most recent call last)

in () ----> 1 import pcl /usr/local/lib/python2.7/dist-packages/pcl/**init**.py in () 1 # XXX do a more specific import! ----> 2 from ._pcl import * 3 4 import sys 5 ImportError: /usr/local/lib/python2.7/dist-packages/pcl/_pcl.so: undefined symbol: _ZN3pcl6search6KdTreeINS_8PointXYZEEC1Eb What vesion of cython? 0.21.1 How did you install pcl? sudo apt-get install libpcl-all This got me libpcl-1.7-all What version of python-pcl? Don't know how to check. Installed it just the other day. Did you build this in a virtualenv? No. What does this report? ldd /usr/local/lib/python2.7/dist-packages/pcl/_pcl.so | grep libpcl libpcl_io.so.1.7 => /usr/lib/libpcl_io.so.1.7 (0x00007f282fc8a000) libpcl_segmentation.so.1.7 => /usr/lib/libpcl_segmentation.so.1.7 (0x00007f282f0fe000) libpcl_features.so.1.7 => /usr/lib/libpcl_features.so.1.7 (0x00007f282d600000) libpcl_filters.so.1.7 => /usr/lib/libpcl_filters.so.1.7 (0x00007f282cd21000) libpcl_surface.so.1.7 => /usr/lib/libpcl_surface.so.1.7 (0x00007f282c6fd000) libpcl_search.so.1.7 => /usr/lib/libpcl_search.so.1.7 (0x00007f282c352000) libpcl_kdtree.so.1.7 => /usr/lib/libpcl_kdtree.so.1.7 (0x00007f282c02b000) libpcl_octree.so.1.7 => /usr/lib/libpcl_octree.so.1.7 (0x00007f282bc3d000) libpcl_common.so.1.7 => /usr/lib/libpcl_common.so.1.7 (0x00007f282b989000) libpcl_io_ply.so.1.7 => /usr/lib/libpcl_io_ply.so.1.7 (0x00007f282a1e9000) libpcl_sample_consensus.so.1.7 => /usr/lib/libpcl_sample_consensus.so.1.7 (0x00007f2826f52000)
rickarmstrong commented 9 years ago

Did the following, and appears to solve the problem: sudo python setup.py clean sudo make clean sudo make all sudo python setup.py install

Probably not the right thing to do, but worked. Could probably use a little blurb at http://strawlab.github.io/python-pcl/index.html that explains how to properly install python-pcl.

Thanks for creating this package, btw.

gismo141 commented 9 years ago

@rickarmstrong Your last post helped me a lot to get the installation done - just started using Python with PCL and I was totally confused on how to install it. Maybe this should be made more clear in the readme.rst of this project.

nzjrs commented 9 years ago

Never sudo pip install

gismo141 commented 9 years ago

@nzjrs What a chance that I didn't used 'sudo' for any command :+1:

julienr commented 8 years ago

I ran into the same problem, but on OSX. The issue was due to the fact that pcl was compiled with clang++/libc++ (the clang standard library) but python-pcl was picking clang++/libstdc++ (the GNU C++ standard library).

Compiling python-pcl with the following solved the problem

CPPFLAGS="-stdlib=libc++ -mmacosx-version-min=10.7" LDFLAGS="-stdlib=libc++ -mmacosx-version-min=10.7" make all
mikeroberts3000 commented 7 years ago

I just encountered this issue too. As suggested by @julienr, I needed to do:

CPPFLAGS="-stdlib=libc++ -mmacosx-version-min=10.7" LDFLAGS="-stdlib=libc++ -mmacosx-version-min=10.7" make all

And I also needed to do:

CPPFLAGS="-stdlib=libc++ -mmacosx-version-min=10.7" LDFLAGS="-stdlib=libc++ -mmacosx-version-min=10.7" python setup.py install
q5390498 commented 6 years ago

hello, I got the same problem on ubuntu, What should I do on Ubuntu? @mikeroberts3000 @julienr

julienr commented 6 years ago

@q5390498 I'm sorry but I can't help you on this. Haven't used python-pcl for a while.