Error In the Code

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
envoy
Beginner
Posts: 4
Joined: Wed Jun 19, 2019 3:10 am

Error In the Code

Post by envoy »

Traceback (most recent call last):
File "autonomousSequence.py", line 37, in <module>
import cflib.crtp
ImportError: No module named cflib.crtp


I am getting this error when I am trying to run this automonous python code - https://github.com/bitcraze/crazyflie-l ... equence.py

What could be the reason for it?
kimberly
Bitcraze
Posts: 559
Joined: Fri Jul 06, 2018 11:13 am

Re: Error In the Code

Post by kimberly »

Hi Envoy,

Seems like the required python library has not installed. Try running this line in a terminal first

Code: Select all

pip3 install cflib
envoy
Beginner
Posts: 4
Joined: Wed Jun 19, 2019 3:10 am

Re: Error In the Code

Post by envoy »

Yeah I did that but still I am facing the same issue.
I installed the library in all the folders possible but still the same issue.
What should I do?
kimberly
Bitcraze
Posts: 559
Joined: Fri Jul 06, 2018 11:13 am

Re: Error In the Code

Post by kimberly »

Once you run that line, it should be working throughout your machine, but strange it is not working:

Just a few questions to better understand your situation:

1. Which operating system/VM do you use?
2. Do you use python2 or python3?
3. Have you tried to install the cflib from source? https://github.com/bitcraze/crazyflie-lib-python
envoy
Beginner
Posts: 4
Joined: Wed Jun 19, 2019 3:10 am

Re: Error In the Code

Post by envoy »

I use the Oracle Virtual Machine VirtualBox (BitcrazeVM)
Python3
Yeah I have already downloaded that
Please let me know what is the cause of this error
kimberly
Bitcraze
Posts: 559
Joined: Fri Jul 06, 2018 11:13 am

Re: Error In the Code

Post by kimberly »

I wasn't getting the error in my VM, but I just did a fresh install to check if there something wrong with the initialization. And yes, I was getting exactly the same error as you were.

The issue was solved by installing the library from source as explained in the README.md file of the crazyflie-lib-python repository:

Code: Select all

 
cd ~/projects/crazyflie-lib-python 
pip3 install -e .
python3 examples/autonomousSequence.py
Does this work for you now?

(I do agree that the cflib should be installed by standard on the VM, so I will make an issue ticket in github, so we will fix that soon. Thank you for reporting it :) )
Post Reply