I am trying to convert a python file into an executable using pyinstaller. The issue is I can’t get a python file which uses the pymavlink library to run as an executable. I am running python 2.7.17 in Ubuntu 18.04. Pymavlink 2.4.14 and Pyinstaller 3.5
Heres an example file:
# imports from pymavlink import mavutil # CONNECT master = mavutil.mavlink_connection('udpin:0.0.0.0:14777') # WAIT FOR HEARTBEAT BEFORE SENDING ANY COMMANDS master.wait_heartbeat() # CHANGE TO FLIGHT MODE DEPTH HOLD MODE master.mav.set_mode_send( master.target_system, mavutil.mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED, 2) #addition to build file into single application with pyinstaller if 0: import UserList import UserString import UserDict import itertools import collections import future.backports.misc import commands import base64 import __buildin__ import math import reprlib import functools import re import subprocess
The additional imports are explicitly added as a solution for libraries that are getting skipped.
The error is as follows:
I edited the spec file to try and circumvent this but haven’t found a solution. Attempting to add the path manually changes the error to
ImportError: No module named v20.ardupilotmega  Failed to execute script rov
If anyone knows a way around this I’d greatly appreciate it