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

pcl problem during importing

Open rebeen opened this issue 8 years ago • 5 comments

I think I have successfully installed pcl but I cannot import pcl

(myenv) rebeen@rebeen-Latitude-7480:~$ cd Downloads/ (myenv) rebeen@rebeen-Latitude-7480:~/Downloads$ cd python-pcl-master/ (myenv) rebeen@rebeen-Latitude-7480:~/Downloads/python-pcl-master$ python setup/py install python: can't open file 'setup/py': [Errno 2] No such file or directory (myenv) rebeen@rebeen-Latitude-7480:~/Downloads/python-pcl-master$ python setup.py install running install running bdist_egg running egg_info writing python_pcl.egg-info/PKG-INFO writing dependency_links to python_pcl.egg-info/dependency_links.txt writing requirements to python_pcl.egg-info/requires.txt writing top-level names to python_pcl.egg-info/top_level.txt reading manifest file 'python_pcl.egg-info/SOURCES.txt' writing manifest file 'python_pcl.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext skipping 'pcl/_pcl_172.cpp' Cython extension (up-to-date) creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/pcl copying build/lib.linux-x86_64-3.6/pcl/_pcl.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/pcl copying build/lib.linux-x86_64-3.6/pcl/init.py -> build/bdist.linux-x86_64/egg/pcl byte-compiling build/bdist.linux-x86_64/egg/pcl/init.py to init.cpython-36.pyc creating stub loader for pcl/_pcl.cpython-36m-x86_64-linux-gnu.so byte-compiling build/bdist.linux-x86_64/egg/pcl/_pcl.py to _pcl.cpython-36.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying python_pcl.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying python_pcl.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying python_pcl.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying python_pcl.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO copying python_pcl.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying python_pcl.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt creating 'dist/python_pcl-0.2-py3.6-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing python_pcl-0.2-py3.6-linux-x86_64.egg removing '/home/rebeen/anaconda3/envs/myenv/lib/python3.6/site-packages/python_pcl-0.2-py3.6-linux-x86_64.egg' (and everything under it) creating /home/rebeen/anaconda3/envs/myenv/lib/python3.6/site-packages/python_pcl-0.2-py3.6-linux-x86_64.egg Extracting python_pcl-0.2-py3.6-linux-x86_64.egg to /home/rebeen/anaconda3/envs/myenv/lib/python3.6/site-packages python-pcl 0.2 is already the active version in easy-install.pth

Installed /home/rebeen/anaconda3/envs/myenv/lib/python3.6/site-packages/python_pcl-0.2-py3.6-linux-x86_64.egg Processing dependencies for python-pcl==0.2 Searching for Cython==0.26.1 Best match: Cython 0.26.1 Adding Cython 0.26.1 to easy-install.pth file Installing cygdb script to /home/rebeen/anaconda3/envs/myenv/bin Installing cython script to /home/rebeen/anaconda3/envs/myenv/bin Installing cythonize script to /home/rebeen/anaconda3/envs/myenv/bin

Using /home/rebeen/anaconda3/envs/myenv/lib/python3.6/site-packages Searching for numpy==1.12.1 Best match: numpy 1.12.1 Adding numpy 1.12.1 to easy-install.pth file

Using /home/rebeen/anaconda3/envs/myenv/lib/python3.6/site-packages Searching for nose==1.3.7 Best match: nose 1.3.7 Adding nose 1.3.7 to easy-install.pth file Installing nosetests script to /home/rebeen/anaconda3/envs/myenv/bin Installing nosetests-3.6 script to /home/rebeen/anaconda3/envs/myenv/bin

Using /home/rebeen/anaconda3/envs/myenv/lib/python3.6/site-packages Searching for filelock==2.0.12 Best match: filelock 2.0.12 Adding filelock 2.0.12 to easy-install.pth file

Using /home/rebeen/anaconda3/envs/myenv/lib/python3.6/site-packages Finished processing dependencies for python-pcl==0.2 (myenv) rebeen@rebeen-Latitude-7480:~/Downloads/python-pcl-master$ python Python 3.6.2 |Anaconda custom (64-bit)| (default, Sep 30 2017, 18:42:57) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

iport pcl File "", line 1 iport pcl ^ SyntaxError: invalid syntax import pcl Traceback (most recent call last): File "", line 1, in File "/home/rebeen/Downloads/python-pcl-master/pcl/init.py", line 2, in from ._pcl import * ModuleNotFoundError: No module named 'pcl._pcl'

rebeen avatar Oct 11 '17 14:10 rebeen

Build depends files first:

python setup.py build_ext -i

then,

sudo python setup.py install

fouvy avatar Dec 17 '17 17:12 fouvy

I think I have similar issue (built and installed without problem), Ubuntu 16.04, pcl 1.8: File "pcd.py", line 1, in import pcl File "/usr/local/lib/python2.7/dist-packages/python_pcl-0.3-py2.7-linux-x86_64.egg/pcl/init.py", line 2, in from ._pcl import * ImportError: libpng16.so.16: cannot open shared object file: No such file or directory

PjPajkis avatar Dec 18 '17 12:12 PjPajkis

Make sure that you have installed OpenNI2 first, that helped me. I followed this link: https://roboticslab-uc3m.gitbook.io/installation-guides/install-openni-nite I installed only OpenNI2 but I already had the Kinect OpenNI2 driver installed, I am not sure whether it is necessary.

spirosperos avatar Nov 29 '18 14:11 spirosperos

Build depends files first:

python setup.py build_ext -i

then,

sudo python setup.py install

@fouvy Solved my problem perfectly. May I ask what exactly does python setup.py build_ext -i do? Do we need to run it every time? If not, when do we need it? Many thanks!

weihaosky avatar Sep 11 '20 07:09 weihaosky

Works for both python2 and python3 (mention python3 if needed)

  • $ sudo pip install cython==0.25.2
  • clone this repo https://github.com/udacity/RoboND-Perception-Exercises
  • $ cd RoboND-Perception-Exercises/python-pcl
  • $ python setup.py build -i
  • $ sudo python setup.py install
  • $ sudo apt-get install pcl-tools
  • export PYTHONPATH=$PYTHONPATH:/usr/local/lib (This is my python path)

If importing pcl outside this directory still give the same error, then uninstall the existing pcl.

  • pip uninstall pcl

aravindsairam avatar Sep 29 '20 13:09 aravindsairam