bitcraze / crazyflie-firmware

The main firmware for the Crazyflie Nano Quadcopter, Crazyflie Bolt Quadcopter and Roadrunner Positioning Tag.
GNU General Public License v3.0
1.21k stars 1.06k forks source link

Python test bindings don't work with setup.py #1358

Open knmcguire opened 8 months ago

knmcguire commented 8 months ago

If I install the python bindings via these instructions and run python tests with python3 -m pytest test_python/ I get the following error:

_____________________________________ ERROR collecting test_python/test_pptraj.py ______________________________________
ImportError while importing test module '/home/knmcguire/development/bitcraze/c/crazyflie-firmware/test_python/test_pptraj.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test_python/test_pptraj.py:4: in <module>
    import cffirmware
/home/knmcguire/.local/lib/python3.8/site-packages/cffirmware-0.1-py3.8.egg/cffirmware.py:15: in <module>
    ???
E   ModuleNotFoundError: No module named '_cffirmware'

I'll need to put the python bindings in PYTHONPATH in order to make it work:
export PYTHONPATH=<PATH_TO_>/crazyflie-firmware/build:$PYTHONPATH

rares99 commented 7 months ago

Hello. I am trying to solve this issue myself and I have a quick question. What is PYTHONPATH in this case?

knmcguire commented 7 months ago

not sure! but you can read it out by echo $PYTHONPATH 😄 its a collection of multiple paths in which python searches for any scripts. (this only works in ubuntu)