loco-3d / crocoddyl

Crocoddyl is an optimal control library for robot control under contact sequence. Its solver is based on various efficient Differential Dynamic Programming (DDP)-like algorithms
BSD 3-Clause "New" or "Revised" License
858 stars 174 forks source link

Some errors happen when importing crocoddyl #1130

Closed candyriver closed 1 year ago

candyriver commented 1 year ago

I am new here and the errors are:

Python 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import crocoddyl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/.local/lib/python3.10/site-packages/cmeel.prefix/lib/python3.10/site-packages/crocoddyl/__init__.py", line 1, in <module>
    from .libcrocoddyl_pywrap import *
ImportError: libboost_chrono.so.1.80.0: cannot open shared object file: No such file or directory
cmastalli commented 1 year ago

Hi @candyriver,

This might be related to a corrupted installation procedure. Can you provide more details on how you have installed Crocoddyl? Please read again the installation instructions.

candyriver commented 1 year ago

I just follow the installation instructions and run the following command in the terminal:

pip install --user crocoddyl

cmastalli commented 1 year ago

@nim65s is aware with pip installation details. He might need further details to understand your situation.

jcarpent commented 1 year ago

@candyriver Conda might be your friend conda install -c conda-forge crocoddyl.

candyriver commented 1 year ago

@candyriver Conda might be your friend conda install -c conda-forge crocoddyl.

Thanks for your reply! But sadly it didn't help.

candyriver commented 1 year ago

After testing with Python 3.6, the error no longer occurred. This suggests that the issue only affects Python 3.10. I carefully reviewed the installation instructions available on https://github.com/loco-3d/crocoddyl/tree/devel and noticed that in the section labeled "From Debian/Ubuntu packages, with robotpkg", it instructs to set the PYTHONPATH environment variable as follows: export PYTHONPATH=/opt/openrobots/lib/python3.10/site-packages:$PYTHONPATH However, upon running apt-cache search robotpkg-py3*, I was unable to find a version of crocoddyl that is compatible with Python 3.10. Upon further investigation, I discovered that the issue is likely caused by the operating system being Ubuntu 18.04. Maybe the issue could be closed.

cmastalli commented 1 year ago

@nim65s -- could you update the readme file before releasing the new version of Crocoddyl?

nim65s commented 1 year ago

@candyriver : we offer multiple installation options. From what I can see here, you tried 2 different:

  1. wheel packages downloaded from pypi.org with eg. pip install crocoddyl → Those packages require python >= 3.7, and the crocoddyl one might not be working until #1128 is out
  2. deb packages downloaded from robotpkg.org with eg apt install robotpkg-py3*-crocoddyl → Those packages require using the python3 provided by your Debian / Ubuntu installation, so in your 18.04 case only 3.6 will work

@jcarpent also provided a third option through conda. I do not know why this one didn't work for you.

candyriver commented 1 year ago

@nim65s Thanks for your attention! Although the OS system is Ubuntu 18.04, I am using the latest conda environment, so my Python version is 3.10. However, I am still unsure why 'pip install --user crocoddyl' or 'conda install -c conda-forge crocoddyl' did not work for me. It's possible that these methods rely on the system installation, which may explain the issue.

To resolve the error message stating 'ImportError: libboost_chrono.so.1.80.0: cannot open shared object file: No such file or directory', I manually compiled and installed boost_1_80_0. However, this led to another error.

nim65s commented 1 year ago

if you are in a conda environment, deb packages installed with apt can't work.

Both pip and conda packages should work, and shouldn't rely on system stuff, but at the moment I think pip wheels are broken for crocoddyl, I'll fix this asap.

cmastalli commented 1 year ago

Closing this issue as @candyriver find a way to install Crocoddyl. Thanks for providing support, @nim65s and @jcarpent!