heremaps / pptk

The Point Processing Toolkit (pptk) is a Python package for visualizing and processing 2-d/3-d point clouds.
https://heremaps.github.io/pptk
MIT License
610 stars 112 forks source link

open viewer without sockets..? #25

Open khavernathy opened 4 years ago

khavernathy commented 4 years ago

I have had a lot of trouble trying to get pptk.viewer() to run on CentOS without root privilege.

The main limitation is that pptk/viewer/viewer.py uses a socket to start up the viewer. The program just hangs after calling pptk.viewer():

Python 3.6.8 (default, Aug  7 2019, 17:28:10)                                                            
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux                                                      
Type "help", "copyright", "credits" or "license" for more information. 
>>> import numpy as np; import pptk; x=np.random.rand(100,3); v = pptk.viewer(x)          

After ^C it shows that the program was hanging on x = s.accept()

After changing s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) to s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.SO_REUSEADDR, 1)

in pptk/viewer/viewer.py I get

Python 3.6.8 (default, Aug  7 2019, 17:28:10) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np; import pptk; x=np.random.rand(100,3); v = pptk.viewer(x)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dmf/.local/lib/python3.6/site-packages/pptk/viewer/viewer.py", line 48, in __init__
    s.bind(('localhost', 0))
OSError: [Errno 88] Socket operation on non-socket
rlangefe commented 3 years ago

I'm having this issue too, more or less. I have X11 set up on a remote server, but when I run pptk.viewer(xyz), it just sits there.

peter-ivarsen commented 2 years ago

Might have had the same issue as you @rlangefe, with X11 forwarding from a linux server, e.g. matplotlib visualizations work, but pptk just sat there. My problem was resolved by following instructions in #3