CoppeliaRobotics / zmqRemoteApi

Other
35 stars 10 forks source link

Build of Java client failed: No module named 'cbor' #10

Closed rgudwin closed 12 months ago

rgudwin commented 12 months ago

I tried to build the Java client from a fresh new install of CoppeliaSim V4_6_0_rev6 in Linux. Following the instructions I moved to

CoppeliaSim_Edu_V4_6_0_rev6_Ubuntu22_04/programming/zmqRemoteApi/clients/java

and then tried:

mvn package -D"GENERATE_INCLUDE_OBJECTS=sim,simIK"

This is what I got:

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
[INFO] Scanning for projects...
[INFO] 
[INFO] --< com.coppeliarobotics.remoteapi.zmq:coppeliaSim-zmqRemoteApi-java >--
[INFO] Building coppeliaSim-zmqRemoteApi-java 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:3.0.0:exec (Extract calltips.json) @ coppeliaSim-zmqRemoteApi-java ---
error: No module named 'cbor'
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)

How can I fix this ?

rgudwin commented 12 months ago

Trying some random things, I was able to get rid of this message, by installing python cbor2 package (that apparently contains cbor). But now a different problem is appearing:

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
[INFO] Scanning for projects...
[INFO] 
[INFO] --< com.coppeliarobotics.remoteapi.zmq:coppeliaSim-zmqRemoteApi-java >--
[INFO] Building coppeliaSim-zmqRemoteApi-java 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:3.0.0:exec (Extract calltips.json) @ coppeliaSim-zmqRemoteApi-java ---
Exception ignored in: <function RemoteAPIClient.__del__ at 0x7f670fb602c0>
Traceback (most recent call last):
  File "/home/rgudwin/Downloads/CoppeliaSim_Edu_V4_6_0_rev6_Ubuntu22_04/programming/zmqRemoteApi/clients/python/src/coppeliasim_zmqremoteapi_client/__init__.py", line 59, in __del__
  File "/home/rgudwin/Downloads/CoppeliaSim_Edu_V4_6_0_rev6_Ubuntu22_04/programming/zmqRemoteApi/clients/python/src/coppeliasim_zmqremoteapi_client/__init__.py", line 89, in _send
Exception: illegal argument PyCapsule_Import could not import module "datetime"
[INFO] 
[INFO] --- exec-maven-plugin:3.0.0:exec (Extract constants.json) @ coppeliaSim-zmqRemoteApi-java ---
[INFO] 
[INFO] --- exec-maven-plugin:3.0.0:exec (Generate Remote API Objects) @ coppeliaSim-zmqRemoteApi-java ---
python3: can't open file '/home/rgudwin/Downloads/CoppeliaSim_Edu_V4_6_0_rev6_Ubuntu22_04/programming/zmqRemoteApi/clients/java/${env.COPPELIASIM_ROOT_DIR}/programming/include/simStubsGen/external/pycpp/pycpp.py': [Errno 2] No such file or directory
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2)
    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:982)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:929)
    at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:457)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:298)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.177 s
[INFO] Finished at: 2023-11-15T14:14:48-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (Generate Remote API Objects) on project coppeliaSim-zmqRemoteApi-java: Command execution failed.: Process exited with an error: 2 (Exit value: 2) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

The strange thing here is that now I have already installed the datetime module it is complaining about ... maybe I have a different version, that is not compatible ? The version I have installed is 5.2-1.

fferri commented 12 months ago

You have to correctly set the COPPELIASIM_ROOT_DIR environment variable.