[SOLVED] CF Client: No module named 'yaml'

Post here to get support
alex
Expert
Posts: 135
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

[SOLVED] CF Client: No module named 'yaml'

Post by alex » Mon Nov 12, 2018 9:40 pm

Hello,

when trying to start the CF Client the following error message shows up:

Code: Select all

ImportError: No module named 'yaml'
The complete terminal output:

Code: Select all

bitcraze@bitcraze-vm:~/projects/crazyflie-clients-python/bin$ python3 cfclient
INFO:cfclient.gui:Disabling STL printouts
INFO:cfclient.utils.input.inputreaders:Input readers: ['linuxjsdev', 'pysdl2']
INFO:cfclient.utils.input.inputreaders:Successfully initialized [linuxjsdev]
INFO:cfclient.utils.input.inputreaders:Could not initialize [pysdl2]: No SDL2 support on Linux
INFO:cfclient.utils.input.inputinterfaces:Found interfaces: ['leapmotion', 'wiimote', 'zmqpull']
INFO:cfclient.utils.input.inputinterfaces:Could not initialize [leapmotion]: Leap Motion library probably not installed (No module named 'leapsdk')
INFO:cfclient.utils.input.inputinterfaces:Could not initialize [wiimote]: Missing cwiid (wiimote) driver No module named 'cwiid'
INFO:cfclient.utils.config:Dist config read from /home/bitcraze/projects/crazyflie-clients-python/src/cfclient/configs/config.json
INFO:cfclient.utils.input.inputinterfaces:Could not initialize [zmqpull]: ZMQ input disabled in config file
===== 2018.11.12 22:11:16 =====
Traceback (most recent call last):
  File "cfclient", line 5, in <module>
    main()
  File "/home/bitcraze/projects/crazyflie-clients-python/src/cfclient/gui.py", line 135, in main
    from .ui.main import MainUI
  File "/home/bitcraze/projects/crazyflie-clients-python/src/cfclient/ui/main.py", line 33, in <module>
    import cfclient.ui.tabs
  File "/home/bitcraze/projects/crazyflie-clients-python/src/cfclient/ui/tabs/__init__.py", line 41, in <module>
    from .locopositioning_tab import LocoPositioningTab
  File "/home/bitcraze/projects/crazyflie-clients-python/src/cfclient/ui/tabs/locopositioning_tab.py", line 51, in <module>
    from cfclient.ui.dialogs.anchor_position_dialog import AnchorPositionDialog
  File "/home/bitcraze/projects/crazyflie-clients-python/src/cfclient/ui/dialogs/anchor_position_dialog.py", line 36, in <module>
    import yaml
ImportError: No module named 'yaml'
Couldn't find any topic with the forum search. Installing PyYAML didn't do the job, unfortunately. Oh, and I am talking about a clean Bitcraze VM 0.8.

Can somebody give a hint to a linux amateur?

Thanks.
Last edited by alex on Wed Nov 14, 2018 6:42 pm, edited 1 time in total.

alex
Expert
Posts: 135
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: CF Client: No module named 'yaml'

Post by alex » Tue Nov 13, 2018 10:32 pm

Just uninstalled and reinstalled PyYAML successfully using

Code: Select all

pip uninstall pyyaml
sudo apt-get install libyaml-dev libpython2.7-dev
pip install pyyaml
But no progress regarding the CF Client startup. Any suggestions? Is this a known issue?

arnaud
Bitcraze
Posts: 1835
Joined: Tue Feb 06, 2007 12:36 pm

Re: CF Client: No module named 'yaml'

Post by arnaud » Wed Nov 14, 2018 7:51 am

I think you need to install either "apt-get install python3-yaml" or "pip3 install pyyaml" since the client is running with Python 3.

alex
Expert
Posts: 135
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: CF Client: No module named 'yaml'

Post by alex » Wed Nov 14, 2018 4:04 pm

Ok, sounds obvious, I overlooked that. I'll give it a try.

When starting cfclient in the freshly imported VM, everything works fine. As soon as the projects were synced and updated with their git repos, the client won't start anymore.

Did you switch to Python 3 since the VM 0.8 was released?

alex
Expert
Posts: 135
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: CF Client: No module named 'yaml'

Post by alex » Wed Nov 14, 2018 6:36 pm

arnaud wrote:
Wed Nov 14, 2018 7:51 am
I think you need to install either "apt-get install python3-yaml" or "pip3 install pyyaml" since the client is running with Python 3.
The first command did the job, thanks.

But the clients still exits on startup due to supposedly disabled 3D acceleration:

Code: Select all

bitcraze@bitcraze-vm:~/projects/crazyflie-clients-python/bin$ python3 cfclient
INFO:cfclient.gui:Disabling STL printouts
INFO:cfclient.utils.input.inputreaders:Input readers: ['linuxjsdev', 'pysdl2']
INFO:cfclient.utils.input.inputreaders:Successfully initialized [linuxjsdev]
INFO:cfclient.utils.input.inputreaders:Could not initialize [pysdl2]: No SDL2 support on Linux
INFO:cfclient.utils.input.inputinterfaces:Found interfaces: ['leapmotion', 'wiimote', 'zmqpull']
INFO:cfclient.utils.input.inputinterfaces:Could not initialize [leapmotion]: Leap Motion library probably not installed (No module named 'leapsdk')
INFO:cfclient.utils.input.inputinterfaces:Could not initialize [wiimote]: Missing cwiid (wiimote) driver No module named 'cwiid'
INFO:cfclient.utils.config:Dist config read from /home/bitcraze/projects/crazyflie-clients-python/src/cfclient/configs/config.json
INFO:cfclient.utils.config:Config file read from [/home/bitcraze/.config/cfclient/config.json]
INFO:cfclient.utils.input.inputinterfaces:Could not initialize [zmqpull]: ZMQ input disabled in config file
INFO:cfclient.utils.zmq_param:Biding ZMQ for parameters at tcp://*:1213
INFO:cfclient.utils.zmq_led_driver:Biding ZMQ for LED driverat tcp://*:1214
INFO:cfclient.utils.input:Using device blacklist [(VirtualBox|VMware)]
INFO:cflib.drivers.cfusb:Looking for devices....
OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.
3D acceleration is already enabled for this VM in VirtualBox. So I additionally updated the VirtualBox Guest Additions --> the client starts as expected!

arnaud, thanks for pointing me in the right direction. Maybe you should release an update for the VM making it easier for inexperienced users who just want to fly?

-alex

arnaud
Bitcraze
Posts: 1835
Joined: Tue Feb 06, 2007 12:36 pm

Re: [SOLVED] CF Client: No module named 'yaml'

Post by arnaud » Thu Nov 15, 2018 8:47 am

It is the yaml dependency that was added since we created the VM. We need to create a new one using Ubuntu 18.04 but I never get the time (if anyone wants to give it a try, it is on github ;-).

As for opengl it is odd, I have never seen that. I just installed the VM, launch the update script, "sudo apt-get install python3-yaml" and the client starts fine for me. I am running Virtualbox 5.2.8 on Linux. What host system are you using?

alex
Expert
Posts: 135
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: [SOLVED] CF Client: No module named 'yaml'

Post by alex » Thu Nov 15, 2018 2:36 pm

I am running the most recent VirtualBox on macOS Mojave. Maybe that‘s the point.

arnaud
Bitcraze
Posts: 1835
Joined: Tue Feb 06, 2007 12:36 pm

Re: [SOLVED] CF Client: No module named 'yaml'

Post by arnaud » Fri Nov 16, 2018 8:31 am

Hi, so I tested on our dev Mac that also run Mojave and the result is quite counter-intuitive: you need to disable 3D acceleration for the VM.

When testing the VM untouched with the latest version of Virtualbox, it works fine. If I enable 3D acceleration in the VM setting then I get the same message as you got.

My assumption is that Linux has a quite good software OpenGL implementation and this is the one that is used if you have 3D disable in the VM. If you enable 3D then it tries to use the 'virtual' OpenGL of the VM and for some reason this does not work (might require newer version of the guest addition maybe).

arnaud
Bitcraze
Posts: 1835
Joined: Tue Feb 06, 2007 12:36 pm

Re: [SOLVED] CF Client: No module named 'yaml'

Post by arnaud » Fri Nov 16, 2018 11:18 am

An update: if you want to activate 3D acceleration on the VM the problem was the guest addition, I updated guest addition and it worked with 3D acceleration activated in the VM. That said, the OpenGL emulation is working very well already so activating 3D on the VM should not be needed.

alex
Expert
Posts: 135
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: [SOLVED] CF Client: No module named 'yaml'

Post by alex » Fri Nov 16, 2018 3:09 pm

Thanks for even further investigating this issue, arnaud. I can confirm the cohesion you described.

Since you’re also running Xubuntu 14.04 as guest on macOS Mojave as host—do you have the same severe performance issues in the VM? It’s impossible to work with it due to input lags for keyboard and mouse clicks.

Is there any solution to this? I‘ve already played around with VirtualBox‘ options regarding RAM, video memory, chipset and 3D acceleration without memorable impact.

Does upgrading to a newer version of Xubuntu increase performance of the VM?

Post Reply