ImportError: No module named cflib.crtp

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
thefeiyu
Beginner
Posts: 12
Joined: Fri Dec 18, 2020 10:07 pm

ImportError: No module named cflib.crtp

Post by thefeiyu »

Hello,

I am trying to use the command:
python position_commander_demo.py

When I run it, it gives me this error:
Traceback (most recent call last):
File "position_commander_demo.py", line 34, in <module>
import cflib.crtp
ImportError: No module named cflib.crtp

How do I fix this error?

Thanks!
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: ImportError: No module named cflib.crtp

Post by kimberly »

It seems that cflib has not been installed on your computer.

Could you run the following command in your terminal?

Code: Select all

pip3 install cflib
Also make sure that your python version is 3.0 or up. Or else use

Code: Select all

python3 position_commander_demo.py
thefeiyu
Beginner
Posts: 12
Joined: Fri Dec 18, 2020 10:07 pm

Re: ImportError: No module named cflib.crtp

Post by thefeiyu »

I have used these commands and it is working now, thank you!

I have also run into another problem when I use the "python3 position_commander_demo.py", it gives me this error: "usb.core.USBError: [Errno 16] Resource busy".

Could you please help me with this problem? Thank you!
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: ImportError: No module named cflib.crtp

Post by kimberly »

Perfect!

that error code means that the USB port of your crazyradio is already been used. This is for instance if you have the cfclient connected to the crazyflie but you want to run a separate pythonscript on that same crazyflie as well using the same crazyradio. This is not possible so you would need to disconnect the crazyflie from the cfclient first.

If this is not the case, usually a quick disconnect and connect of the Crazy radio PA quickly fixes things as well.
Post Reply