pptk icon indicating copy to clipboard operation
pptk copied to clipboard

open viewer without sockets..?

Open khavernathy opened this issue 4 years ago • 2 comments

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

khavernathy avatar Nov 26 '19 21:11 khavernathy

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.

rlangefe avatar Mar 18 '21 19:03 rlangefe

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

peter-ivarsen avatar Jun 22 '22 12:06 peter-ivarsen