RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.35k stars 1.27k forks source link

Pip install drake fails on fresh Ubuntu 24.04 Python Virtual Environment. #22138

Closed AlexandreAmice closed 2 weeks ago

AlexandreAmice commented 2 weeks ago

What happened?

When I launch a fresh python virtual environment and install Drake from pip I get the following error (note what I import does not matter).

from pydrake.all import HPolyhedron
AttributeError: module 'drake' has no attribute 'experimental_lcmt_deformable_tri'

The above exception was the direct cause of the following exception:

ImportError: initialization failed

The above exception was the direct cause of the following exception:

ImportError: initialization failed

The above exception was the direct cause of the following exception:

ImportError: initialization failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/amice/Desktop/tmp/lib/python3.12/site-packages/pydrake/all.py", line 42, in <module>
    from .perception import *
ImportError: initialization failed

Perhaps one of our dependencies got updated and broke something?

Version

1.30-1.34 I haven't tried lower

What operating system are you using?

Ubuntu 24.04

What installation option are you using?

pip install drake

Relevant log output

No response

jwnimmer-tri commented 2 weeks ago

Most likely the problem is that you have a (wrong) drake directory on your PYTHONPATH somewhere. Remember that . is on the PYTHONPATH by default, so your cwd matters when launching the interpreter.

You can debug with something like import drake; print(drake.__file__);.