Closed carol-fan closed 3 years ago
I have encountered the same problem.
I launched the gateway using Java file, and then when I tried to import got the error 'JavaPackage' object is not callable
There was another ticket with the same issue. I believe this to have been fixed. Sorry about taking so long!
Environment: 1,HW:Raspberry Pi 4 2,OS:Linux 3,Python: 3.7 4,Java:JDK11 5,py4j:0.10.8.1 6:PyBoof:0.36.1
Summery: I have installed pyboof successfully by pip3 on the command line . But when I tried to import pyboof ,a Py4networkError error occured.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/pi/.local/lib/python3.7/site-packages/py4j/java_gateway.py", line 1096, in start self.socket.connect((self.address, self.port)) ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in
File "/home/pi/.local/lib/python3.7/site-packages/pyboof/init.py", line 227, in
from pyboof.calib import
File "/home/pi/.local/lib/python3.7/site-packages/pyboof/calib.py", line 2, in
from pyboof.ip import
File "/home/pi/.local/lib/python3.7/site-packages/pyboof/ip.py", line 25, in
class ThresholdType:
File "/home/pi/.local/lib/python3.7/site-packages/pyboof/ip.py", line 27, in ThresholdType
FIXED = gateway.jvm.boofcv.factory.filter.binary.ThresholdType.FIXED
File "/home/pi/.local/lib/python3.7/site-packages/py4j/java_gateway.py", line 1678, in getattr
"\n" + proto.END_COMMAND_PART)
File "/home/pi/.local/lib/python3.7/site-packages/py4j/java_gateway.py", line 1012, in send_command
connection = self._get_connection()
File "/home/pi/.local/lib/python3.7/site-packages/py4j/java_gateway.py", line 960, in _get_connection
connection = self._create_connection()
File "/home/pi/.local/lib/python3.7/site-packages/py4j/java_gateway.py", line 966, in _create_connection
connection.start()
File "/home/pi/.local/lib/python3.7/site-packages/py4j/java_gateway.py", line 1108, in start
raise Py4JNetworkError(msg, e)
py4j.protocol.Py4JNetworkError: An error occurred while trying to connect to the Java server (127.0.0.1:25333)
Tried things: It seems like launching the java Gateway failed. So I tried to alert the pyboof/init.py `gateway = JavaGateway.launch_gateway()
gateway = JavaGateway()
`
Then the java gateway is ok,but a new error occured.
I have used pyboof successfully on Mac, but the same way didn't work well on Raspberry Pi .Could you help with it.