Posts

Showing posts with the label pyinstaller

PyInstaller - How do you handle environmental variables?

PyInstaller - How do you handle environmental variables? Background: I am trying to convert a python script to an executable file that can be used on other computers. I decided to use PyInstaller. I am using Python 2.7.13 / Anaconda 2.2.0 (64-bit) . I have of course seen many examples and I can achieve this for basic examples. However, the script I am now working on uses environmental variables. The following block of code appears at the start of my python script: import os # force qt4 os.environ['ETS_TOOLKIT'] = 'qt4' os.environ['QT_API'] = 'pyqt' from traits.api import HasTraits, Range, Instance, Button, on_trait_change, Bool, Str, Enum, Float, Int from traitsui.api import View, Item, Group, HGroup, spring, Handler, Action, InstanceEditor, Menu, MenuBar, message, Tabbed from mayavi.core.ui.api import MayaviScene, SceneEditor, MlabSceneModel from pyface.api import FileDialog, OK import yaml from mayavi import mlab import numpy as np from collections...

Pyinstaller 3.3.1 & 3.4.0-dev build with apscheduler

Pyinstaller 3.3.1 & 3.4.0-dev build with apscheduler Greeting! I'm trying to make a build using PyInstaller. Config: Python 3.6.5 pip 10.0.1 , OS: Ubuntu 18.04 . Using virtualenv (also tried with python -m venv ). Python 3.6.5 pip 10.0.1 Ubuntu 18.04 virtualenv python -m venv My app using an apscheduler , websocket , _thread and it seems like some related modules have import problems. Tried pyinstaller --onefile mymain.spec & pyinstaller --onedir mymain.spec . Problem persists in both cases. Program working without errors if not frozen. apscheduler websocket _thread pyinstaller --onefile mymain.spec pyinstaller --onedir mymain.spec here is the error i'm getting if i try to run the generated executable: Traceback (most recent call last): File "apscheduler/schedulers/base.py", line 882, in _create_plugin_instance KeyError: 'interval' During handling of the above exception, another exception occurred: Traceback (most recent call last): Fi...