lessthanoptimal / PyBoof

Python wrapper around the BoofCV Computer Vision Library
Apache License 2.0
64 stars 12 forks source link

py4j.protocol.Py4JNetworkError #8

Closed carol-fan closed 3 years ago

carol-fan commented 3 years ago

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.

import pyboof Launching Java process エラー: メイン・クラスpyboof.PyBoofEntryPointのロード中にLinkageErrorが発生しました java.lang.UnsupportedClassVersionError: pyboof/PyBoofEntryPoint has been compiled by a more recent version of the Java Runtime (class file version 58.0), this version of the Java Runtime only recognizes class file versions up to 55.0 Failed to successfully launch the JVM after 5 seconds. Aborting Traceback (most recent call last): File "/home/pi/.local/lib/python3.7/site-packages/py4j/java_gateway.py", line 958, in _get_connection connection = self.deque.pop() IndexError: pop from an empty deque

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.

import pyboof Traceback (most recent call last): File "", line 1, in File "/home/pi/.local/lib/python3.7/site-packages/pyboof/init.py", line 101, in if not check_jvm(False): File "/home/pi/.local/lib/python3.7/site-packages/pyboof/init.py", line 49, in check_jvm gateway.jvm.pyboof.PyBoofEntryPoint.nothing() TypeError: 'JavaPackage' object is not callable

I have used pyboof successfully on Mac, but the same way didn't work well on Raspberry Pi .Could you help with it.

databaaz commented 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

lessthanoptimal commented 3 years ago

There was another ticket with the same issue. I believe this to have been fixed. Sorry about taking so long!