dimatura / pypcd

PCL pcd fileformat i/o in Python
Other
265 stars 196 forks source link

Python 3 support #7

Open Ylannl opened 7 years ago

Ylannl commented 7 years ago

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.

David-Estevez commented 7 years ago

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?

klintan commented 6 years ago

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.

dimatura commented 6 years ago

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

maierd commented 5 years ago

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

dongqiaqia commented 4 years ago

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"]

SBCV commented 3 years ago

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

jingyibo123 commented 1 year ago

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.

SBCV commented 1 year ago

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

jacoblambert commented 5 months ago

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

jingyibo123 commented 5 months ago

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...