Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after installing python bindings #1762

Closed
MissingSignal opened this issue Dec 9, 2024 · 7 comments · Fixed by #1763
Closed

Error after installing python bindings #1762

MissingSignal opened this issue Dec 9, 2024 · 7 comments · Fixed by #1763

Comments

@MissingSignal
Copy link

Dear mantainers,

When compiling the Superbuild with ROBOTOLOGY_USES_PYTHON=ON I get two folders in robotology-superbuild/build/install/lib/ :

Python3
└── dist-packages
    ├── yarp-3.10.1.dist-info
    │   ├── INSTALLER
    │   └── METADATA
    ├── yarp.py
    └── _yarp.so
Python3.12
└── dist-packages
    ├── icub_models
    │   ├── icub_models.py
    │   └── __init__.py
    ├── icub_models-3.0.0.dist-info
    │   ├── INSTALLER
    │   └── METADATA
    ├── icub.py
    └── _icub_python.so

When I ask Python to import yarp I get No module named 'yarp'


A dirty workaround is to simply copy the content of /Python3 folder into /Python3.12 but ...
What is the best way to handle this problem ?

Many thanks in advance !

@traversaro
Copy link
Member

Thanks @MissingSignal for reporting the problem!

Can you please specify:

  • Which Linux distribution are you using?
  • How did you installed the robotology-superbuild dependencies (i.e. apt or conda).
  • Did you run the installation in a virtual environments? Did you installed any package via pip ?

To quickly report on the installed software, you can also run curl -fsSL https://raw.githubusercontent.com/ami-iit/log-installed-software/main/src/log.py | python and report the generated installed_software.txt file.

@traversaro
Copy link
Member

Also, can you report the content of robotology-superbuild/build/install/share/robotology-superbuild/setup.sh ?

@MissingSignal
Copy link
Author

Sorry @traversaro for the missing details:

  • I'm using a fresh installation of Ubuntu 24.04
  • I opted for the installation from source using apt
  • The installation is "system-wise" using the default python 3.12 bundled with ubuntu 24.04
here the generated setup.sh

export ROBOTOLOGY_SUPERBUILD_SOURCE_DIR=/usr/local/src/robot/robotology-superbuild
export ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX=/usr/local/src/robot/robotology-superbuild/build/install

export PATH=$PATH:$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX/bin


export YARP_DATA_DIRS=${YARP_DATA_DIRS:+${YARP_DATA_DIRS}:}$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX/share/yarp:$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX/share/iCub:$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX/share/ICUBcontrib:$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX/share/ergoCub

export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:+${CMAKE_PREFIX_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/lib
export BLOCKFACTORY_PLUGIN_PATH=${BLOCKFACTORY_PLUGIN_PATH:+${BLOCKFACTORY_PLUGIN_PATH}:}$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX/lib/blockfactory
export XDG_DATA_DIRS=${XDG_DATA_DIRS:-"/usr/local/share:/usr/share"}:$ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX/share


export GZ_SIM_SYSTEM_PLUGIN_PATH=${GZ_SIM_SYSTEM_PLUGIN_PATH:+${GZ_SIM_SYSTEM_PLUGIN_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/lib
export GZ_SIM_RESOURCE_PATH=${GZ_SIM_RESOURCE_PATH:+${GZ_SIM_RESOURCE_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share/gazebo/models:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share/iCub/robots:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share/ergoCub/robots:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share/gazebo/worlds

export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH:+${ROS_PACKAGE_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share
export AMENT_PREFIX_PATH=${AMENT_PREFIX_PATH:+${AMENT_PREFIX_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH:+${GAZEBO_MODEL_PATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share/gazebo/models:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share/iCub/robots:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/share/ergoCub/robots

export PYTHONPATH=${PYTHONPATH:+${PYTHONPATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/lib/python3.12/dist-packages
export PATH=$PATH:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/lib/python3.12/dist-packages/bin

@traversaro
Copy link
Member

Thanks for the issue! There were two problems in the current code, both fixed in #1763 . Once #1763 is merged, you can update the superbuild and everything should work fine.

@traversaro
Copy link
Member

I will also cherry-pick the fix on the releases/2024.11 branch, so it is ready for a possible future 2024.11.2 release.

@traversaro
Copy link
Member

@MissingSignal the problem should have been fixed by #1763, feel free to comment if you still have the problem.

@MissingSignal
Copy link
Author

@traversaro I confirm #1763 fixed the problem.
Thank you for the lightning-fast support 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants