ImportError: No module named 'cfloader'

Post here to get support
Post Reply
gurkbert
Beginner
Posts: 4
Joined: Wed Sep 28, 2016 9:04 am

ImportError: No module named 'cfloader'

Post by gurkbert »

Hello,

I'm experiencing some errors when i try to update the firmware of the crazyflie 2.0. I have no problem to compile the code using 'make' but when I try to use cload i get the following error:

Code: Select all

~/Workspace/crazyflie-firmware$ make cload
../crazyflie-clients-python/bin/cfloader  flash cf2.bin stm32-fw
Traceback (most recent call last):
  File "../crazyflie-clients-python/bin/cfloader", line 2, in <module>
    from cfloader import main
ImportError: No module named 'cfloader'
Makefile:354: recipe for target 'cload' failed
make: *** [cload] Error 1
I'm using Ubuntu 16.04. Does anybody have a suggestion on how to solve this problem?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: ImportError: No module named 'cfloader'

Post by arnaud »

This looks like what would happen if you did not install the client with pip. Did you do it as described in the readme: https://github.com/bitcraze/crazyflie-c ... pplication?
gurkbert
Beginner
Posts: 4
Joined: Wed Sep 28, 2016 9:04 am

Re: ImportError: No module named 'cfloader'

Post by gurkbert »

I installed cfclient using the following command and i seemed to execute properly:

Code: Select all

~/Workspace/crazyflie-lib-python$ pip3 install -e .
The installation of the dependencies also seemed to work.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: ImportError: No module named 'cfloader'

Post by tobias »

And did you install the crazyflie-clients-python as well?
gurkbert
Beginner
Posts: 4
Joined: Wed Sep 28, 2016 9:04 am

Re: ImportError: No module named 'cfloader'

Post by gurkbert »

I'm not sure that i understand, isn't that what

Code: Select all

pip3 install -e .
is for?
gurkbert
Beginner
Posts: 4
Joined: Wed Sep 28, 2016 9:04 am

Re: ImportError: No module named 'cfloader'

Post by gurkbert »

I managed to circumvent the problem by adding the paths manually:

Code: Select all

export PYTHONPATH=/home/myname/Workspace/crazyflie-clients-python/src/
Will this turn out to be problematic in any unexpected way?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: ImportError: No module named 'cfloader'

Post by arnaud »

If it works then it is good, though it is very strange that pip did not work. This is basically what pip should have done for you. I will run some test in a vm with a clean ubuntu to try to reproduce the problem.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: ImportError: No module named 'cfloader'

Post by arnaud »

I cannot reproduce the problem. On a clean Ubuntu 16.04 I did:

Code: Select all

sudo apt-get install python3-pip
git clone https://github.com/bitcraze/crazyflie-clients-python
cd crazyflie-clients-python
pip install --user -e .
sudo apt-get install python3-pyqt4 python3-pyqtgraph

cfclient # works
cfloader # works
Post Reply