Page 1 of 1

Error In the Code

Posted: Wed Jul 10, 2019 6:28 am
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?

Re: Error In the Code

Posted: Thu Jul 11, 2019 6:39 am
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

Re: Error In the Code

Posted: Fri Jul 12, 2019 2:33 am
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?

Re: Error In the Code

Posted: Fri Jul 12, 2019 12:37 pm
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

Re: Error In the Code

Posted: Mon Jul 15, 2019 2:27 am
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

Re: Error In the Code

Posted: Tue Jul 16, 2019 1:16 pm
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 :) )