Use IDLE to run Olympe python programs in Linux

Hello,

I can use
source ~/code/parrot-groundsdk/./products/olympe/linux/env/shell
to setup and use python Olympe programs from the terminal. But when I try to run the same program after loading the python program into the IDLE IDE I get the error below. Any suggestion on how to use the source command with IDLE.

thanks
John Porter

Traceback (most recent call last):
File “/home/jp/code/OlympieExamplePrograms/moveby.py”, line 1, in
import olympe
File “/home/jp/code/parrot-groundsdk/packages/olympe/src/olympe/init.py”, line 6, in
import olympe.arsdkng.module_loader
File “/home/jp/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/module_loader.py”, line 59, in
from olympe.arsdkng.enums import ArsdkEnums, ArsdkEnum, ArsdkBitfield
File “/home/jp/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/enums.py”, line 35, in
from future.builtins import str, bytes
ModuleNotFoundError: No module named ‘future’

Hello,

I am not familiar with IDLE but I think that your specific error is due to the fact that IDLE doesn’t run in the olympe python3 virtual environment.

Try to launch IDLE this way instead:

python -m idlelib.idle

Source:

After starting IDLE this way I’ve hit another error io.UnsupportedOperation:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import olympe
  File "/home/ndessart/code/groundsdk/packages/olympe/src/olympe/__init__.py", line 23, in <module>
    faulthandler.enable()
io.UnsupportedOperation: fileno

According to the top answer of this SO question “so... if you get this error, run the command from straight up Python instead” :

I’ve just commented this non-essential line of code (init.py:23) and managed to import olympe after that. Please note that I have absolutely no idea what other issue might arise further down with IDLE…

If you’re looking for an nice interactive Python console, you should have a look at ipython, we don’t have any issue with it.

1 Like