pypcd icon indicating copy to clipboard operation
pypcd copied to clipboard

Python 3 support

Open Ylannl opened this issue 9 years ago • 10 comments

It would be great if this module worked with Python 3. Currently it does not properly import.

I briefly looked into it and it looks like the python-lzf module (not Python 3 compatible) could be the culprit. However, Python 3 appears to have this functionality built-in.

Ylannl avatar Aug 09 '16 10:08 Ylannl

Same thing here, in my case the error is the following:

/usr/local/lib/python3.4/dist-packages/pypcd/pypcd.py in <module>()
     11 import struct
     12 import copy
---> 13 import cStringIO as sio
     14 import numpy as np
     15 import warnings

ImportError: No module named 'cStringIO'

Which it seems to be removed from Python 3 in favor of io: http://stackoverflow.com/questions/28200366/python-3-4-0-email-package-install-importerror-no-module-named-cstringio

@dimatura Do you have any plans on supporting Python 3? Would you be interested in in help or even a pull request adding support to Python 3?

David-Estevez avatar Feb 15 '17 15:02 David-Estevez

I got all tests passing for Python 3, this PR https://github.com/dimatura/pypcd/pull/9 , needed to change a bunch of things but I think it should be working now.

klintan avatar Feb 02 '18 09:02 klintan

I don't use python 3 personally, yet. Some day. I'll check out @klintan's PR. Ideally it would work on both.

dimatura avatar Mar 15 '18 23:03 dimatura

@dimatura are you considering to merge @klintan's pull request? Seems to work fine under Python 3.

maierd avatar Jul 23 '18 12:07 maierd

python3.6 centos6 pypcd runs successfully. 1、 Reference to #28 ,You can install it with pip using pip3 install --upgrade git+https://github.com/klintan/pypcd.git . 2、use pypcd as follow: from pypcd import pypcd points_pcd = pypcd.PointCloud.from_path(lidar_path) x = points_pcd.pc_data["x"] y = points_pcd.pc_data["y"] z = points_pcd.pc_data["z"]

dongqiaqia avatar Mar 10 '20 02:03 dongqiaqia

Another option would be to use the pyntcloud library - which also supports pcd files and is still actively maintained

SBCV avatar Sep 27 '20 19:09 SBCV

Another option would be to use the pyntcloud library - which also supports pcd files and is still actively maintained

They refuse to support the lzf compressed .pcd format, I think pypcd is the only python library that supports binary-compressed pcd format.

jingyibo123 avatar Dec 16 '22 10:12 jingyibo123

What do you mean with "refuse"? In my experience the maintainer (daavoo) is very cooperative - so far, all my PR's have been merged.

SBCV avatar Dec 16 '22 10:12 SBCV

Just wanted to point out pypcd4 is another alternative for python3, building on @dimatura great work.

jacoblambert avatar Jan 11 '24 00:01 jacoblambert

What do you mean with "refuse"? In my experience the maintainer (daavoo) is very cooperative - so far, all my PR's have been merged.

Apologies for the bold wording.. I was probably intimidated by this msg, I suppose a PR for lzf support could be eventually merged but I gave up on legacy pcd files...

jingyibo123 avatar Jan 19 '24 02:01 jingyibo123