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

Fail to import pcl in Ubuntu 16.04

Open wangg12 opened this issue 7 years ago • 11 comments

I installed pcl via sudo apt install libpcl-dev and then installed python-pcl. The build process looked good, but I could not import pcl in python.

In [1]: import pcl
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-dcd28fa30e40> in <module>()
----> 1 import pcl

/data/wanggu/anaconda3/envs/py27/lib/python2.7/site-packages/pcl/__init__.py in <module>()
      1 # XXX do a more specific import!
----> 2 from ._pcl import *
      3 # vtkSmartPointer.h error (Linux)
      4 # from .pcl_visualization import *
      5 # from .pcl_grabber import *

ImportError: /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.7: undefined symbol: _ZN3pcl9PCDWriter10writeASCIIERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_14PCLPointCloud2ERKN5Eigen6MatrixIfLi4ELi1ELi0ELi4ELi1EEERKNSC_10QuaternionIfLi0EEEi

How can I fix this problem?

wangg12 avatar Jan 12 '18 06:01 wangg12

Same problem here!

pclucas14 avatar Feb 06 '18 14:02 pclucas14

怎么解决啊老哥

sunsssk avatar May 22 '18 09:05 sunsssk

I met the same problem! @wangg12 have you solved it? when executing ldd _pcl.cpython-36m-x86_64-linux-gnu.so: linux-vdso.so.1 => (0x00007fff71bac000) libpcl_registration.so.1.8 => not found libpcl_segmentation.so.1.8 => not found libpcl_features.so.1.8 => not found libpcl_ml.so.1.8 => not found libpcl_surface.so.1.8 => not found libpcl_tracking.so.1.8 => not found libpcl_filters.so.1.8 => not found libpcl_sample_consensus.so.1.8 => not found libpcl_visualization.so.1.8 => not found libpcl_io.so.1.8 => not found libpcl_search.so.1.8 => not found libpcl_kdtree.so.1.8 => not found libflann_cpp.so.1.8 => /usr/lib/x86_64-linux-gnu/libflann_cpp.so.1.8 (0x00007fa034179000) libpcl_octree.so.1.8 => not found libpcl_common.so.1.8 => not found libpython3.6m.so.1.0 => /home/cyc/anaconda3/lib/libpython3.6m.so.1.0 (0x00007fa033c35000) libboost_system.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007fa033a31000) libstdc++.so.6 => /home/cyc/anaconda3/lib/libstdc++.so.6 (0x00007fa0336f7000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa0333ee000) libgcc_s.so.1 => /home/cyc/anaconda3/lib/libgcc_s.so.1 (0x00007fa0331dc000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa032fbf000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa032bf5000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa0329f1000) libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fa0327ee000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa0325e6000) /lib64/ld-linux-x86-64.so.2 (0x00007fa034775000) and i find all these files locate in /usr/locate/bin/

How could solve it?

cyc790 avatar Jun 02 '18 02:06 cyc790

@cyc790 Sorry, I've not solved it yet.

wangg12 avatar Jun 02 '18 13:06 wangg12

Facing the same issue :(

Jyothikumar-b avatar Jul 11 '18 10:07 Jyothikumar-b

@Jyothikumar-b Please try this

  1. $ sudo pip install cython
  2. clone this repo https://github.com/udacity/RoboND-Perception-Exercises/tree/master/python-pcl
  3. $ cd python-pcl
  4. $ python setup.py build
  5. $ sudo python setup.py install
  6. $ sudo apt-get install pcl-tools

Restart the system.. try import pcl

ghost avatar Jul 11 '18 11:07 ghost

Anybody got the solution?

mkt1412 avatar May 28 '19 21:05 mkt1412

@mkt1412

Did you try these steps?

$ sudo pip install cython
clone this repo https://github.com/udacity/RoboND-Perception-Exercises/tree/master/python-pcl
$ cd python-pcl
$ python setup.py build
$ sudo python setup.py install
$ sudo apt-get install pcl-tools

Restart the system.. try import pcl

ghost avatar May 29 '19 03:05 ghost

In python setup.py build got error setup.py: error: cannot find PCL, tried pkg-config pcl_common-1.9 pkg-config pcl_common-1.8 pkg-config pcl_common-1.7 pkg-config pcl_common

kiranintellify avatar Jul 17 '19 10:07 kiranintellify

some problem, tried every solution but still fail to import (in Ubuntu 18.04).

robbiedood avatar May 06 '20 09:05 robbiedood

simply run this in your terminal:

sudo apt-get install libpcl-visualization1.7

And if you further run into this error: ImportError: libflann_cpp.so.1.8: cannot open shared object file: No such file or directory, then run:

sudo apt-get install libflann1.8

Then you should be good!

BillChan226 avatar Jun 13 '23 09:06 BillChan226