connecting to remote Python

44 views
Skip to first unread message

Richard van Bemmelen

unread,
Dec 2, 2017, 9:20:50 AM12/2/17
to Py4J Support and Comments
Can I enter an IP address other than localhost? I do not see a host option in the Gateway, only a port. Maybe I'm overlooking it...

Tim Westbrook

unread,
Dec 2, 2017, 7:21:01 PM12/2/17
to Richard van Bemmelen, Py4J Support and Comments

On 2 December 2017 at 06:20, Richard van Bemmelen <zappf...@gmail.com> wrote:
Can I enter an IP address other than localhost? I do not see a host option in the Gateway, only a port. Maybe I'm overlooking it...

--
You received this message because you are subscribed to the Google Groups "Py4J Support and Comments" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4j+uns...@py4j.org.
To post to this group, send email to py...@py4j.org.
To view this discussion on the web visit https://groups.google.com/a/py4j.org/d/msgid/py4j/e563bce7-ecfa-4e2f-9c20-e4ee1f667ee8%40py4j.org.

Richard

unread,
Dec 5, 2017, 9:20:54 AM12/5/17
to Tim Westbrook, Py4J Support and Comments

I'm trying to connect from Python on my Mac to a NetBeans app on my Windows machine.
I get:

Traceback (most recent call last):
  File "/Users/richard/PycharmProjects/py4jtest/callback_listener.py", line 34, in <module>
    gateway = JavaGateway(callback_server_parameters=CallbackServerParameters(address='192.168.1.9'))
  File "/Library/Python/2.7/site-packages/py4j/java_gateway.py", line 1659, in __init__
    self.start_callback_server(self.callback_server_parameters)
  File "/Library/Python/2.7/site-packages/py4j/java_gateway.py", line 1733, in start_callback_server
    self._callback_server.start()
  File "/Library/Python/2.7/site-packages/py4j/java_gateway.py", line 2044, in start
    raise Py4JNetworkError(msg, e)
py4j.protocol.Py4JNetworkError: An error occurred while trying to start the callback server (192.168.1.9:25334)

I would expect maybe some more info, like a socket error (connection refused, etc)
What could cause this?

Richard

Barthelemy Dagenais

unread,
Dec 9, 2017, 8:44:14 AM12/9/17
to Richard, Py4J Support and Comments
Hi Richard, I am also surprised you did not get a more verbose output.

Can you enable logging
(https://www.py4j.org/faq.html#how-to-turn-logging-on-off)?

It looks like the error occurred while binding to the ip/port. This
can happen if you had another py4j instance running or if you have a
restrictive firewall that blocks port binding.
> https://groups.google.com/a/py4j.org/d/msgid/py4j/8101a416-7b6e-c6d0-ea46-e7ea33017454%40gmail.com.

Richard van Bemmelen

unread,
Dec 10, 2017, 3:41:20 PM12/10/17
to Py4J Support and Comments
Turning on logging did not provide useful information. I also tried it from my Raspberry Pi (Python on the Pi) and Java on my Mac. Even turned the firewall off. The same result....

Op zaterdag 9 december 2017 14:44:14 UTC+1 schreef Barthelemy Dagenais:

אורן קוברטובסקי

unread,
Aug 31, 2022, 2:59:40 AM8/31/22
to Py4J Support and Comments, zappf...@gmail.com
Hello, are there any updates on how to solve this problem?
Reply all
Reply to author
Forward
0 new messages