director icon indicating copy to clipboard operation
director copied to clipboard

ImportError:No module named PythonQt

Open Jerryxiaoyu opened this issue 6 years ago • 3 comments

I downloaded the latest Drake precompiled release and tried to run the following code:

 from director.consoleapp import ConsoleApp

app = ConsoleApp()
view = app.createView()
view.showMaximized()
app.start()

but got the error ImportError: No module named PythonQt Is there something that I need to add to PYTHONPATH ?

Jerryxiaoyu avatar Oct 17 '19 09:10 Jerryxiaoyu

Hi @Jerryxiaoyu,

The director package comes with a binary named directorPython. Try using this instead of python to launch the program. PythonQt is not a standard python module that can be found in the python path, it has to be initialized from C++. The directorPython command line program is equivalent to python but it manages the initialization of Qt and PythonQt.

patmarion avatar Oct 17 '19 14:10 patmarion

Great! I complied the director package and used directorPython to run the program. It works well. Thanks a lot! @patmarion

Jerryxiaoyu avatar Oct 18 '19 02:10 Jerryxiaoyu

Great, glad it worked!

I have a change that I've been experimenting with that removes the requirement of using directorPython. I might land something like this in the future after a little more testing.

https://github.com/RobotLocomotion/director/pull/629

cc @EricCousineau-TRI

patmarion avatar Oct 18 '19 13:10 patmarion