Page 1 of 1

ImportError: No module named 'cfloader'

Posted: Wed Sep 28, 2016 9:42 am
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?

Re: ImportError: No module named 'cfloader'

Posted: Wed Sep 28, 2016 10:06 am
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?

Re: ImportError: No module named 'cfloader'

Posted: Wed Sep 28, 2016 11:45 am
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.

Re: ImportError: No module named 'cfloader'

Posted: Thu Sep 29, 2016 8:36 am
by tobias
And did you install the crazyflie-clients-python as well?

Re: ImportError: No module named 'cfloader'

Posted: Thu Sep 29, 2016 11:31 am
by gurkbert
I'm not sure that i understand, isn't that what

Code: Select all

pip3 install -e .
is for?

Re: ImportError: No module named 'cfloader'

Posted: Thu Sep 29, 2016 1:29 pm
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?

Re: ImportError: No module named 'cfloader'

Posted: Tue Oct 04, 2016 9:44 am
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.

Re: ImportError: No module named 'cfloader'

Posted: Thu Oct 06, 2016 10:54 am
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