raisimTech / raisimLib

Visit www.raisim.com
http://www.raisim.com
Other
341 stars 91 forks source link

raisimPy build problem #490

Closed Lr-2002 closed 1 year ago

Lr-2002 commented 1 year ago

After run the command -DRAISIM_PY=ON, the py-lib was just generated in the $LOCAL_INSTALL rather than the site-packages of python3. And there was just some .so lib without setup.py or so My raisim is 1.1.5 How to install the py lib?

jhwangbo commented 1 year ago

Is it the latest version? the latest version should install the raisimPy to the site-packages

Lr-2002 commented 1 year ago

nope

the latest is 1.1.7 however I could just check 1.1.5 on my pc and the git info are as following

commit 78d5b52f7cd416d602246c86cdebf6ca33562681 (HEAD -> main)
Author: Lr-2002 
Date:   Thu Mar 17 22:06:36 2022 +0800

    blog auto commit from ubuntu 20.04

commit a5352128a7708adab939cd2c0902a73e668ad850
Author: Lr-2002
Date:   Thu Mar 17 21:49:57 2022 +0800

    first commit

commit 22e57670f717eb928bca39aeeda371920b7428ea
Author: Lr-2002 
Date:   Thu Mar 17 21:48:36 2022 +0800

    first commit

commit 7753f9267bc12a494f3b2f4a5aeccea1c54945a8
Author: Lr-2002
Date:   Thu Mar 17 21:48:21 2022 +0800

    first commit
jhwangbo commented 1 year ago

Then, I can only say that you have to update the version.

If you want to keep the old version, you have to check the changes in the raisimPy CMakeLists.txt file and copy the changes

Lr-2002 commented 1 year ago

thanks, it's was my problem

Lr-2002 commented 1 year ago

To be honest, I've changed the whole raisimlib the raisimpy was installed in the site-packages with raisimpy.cpython.. however, when running the robot.py in the raisimpy/example the problem was like this: ImportError: libraisim.so.1.1.7: cannot open shared object file: No such file or directory

It might be the reason of the cmakelist?

I build a test.py in the linux(raisimLib/raisim/linux/lib)

run python test.py locally in raisimLib/raisim/linux/lib , it worked while not useful in the pycharm

jhwangbo commented 1 year ago

did you add the raisim directory to the environment variable LD_LIBRARY_PATH?

Lr-2002 commented 1 year ago

solved, need to add LD_LIBRARY_PATH to config

but it seems still not able to find the declaration using pycharm

jhwangbo commented 1 year ago

I don't use Pycharm but it should be very similar to Clion. There are two ways,

  1. You can modify the desktop icon of Pycharm to launch with the environment variable
  2. You can edit the launch configuration of the python script in Pycharm to include the environment variable. You have to do this for every script you run in Pycharm