Anaconda Python, Pyinstaller 3.1.1, script to exe, run time error

YunliuStorage

Encountered error message "pyi_rth_pkgres.py returns -1"
when running python script (Python version 3.5.1) to exe in Anaconda 64 environment, compiled (compilation process did not have any errors) by Pyinstaller 3.1.1 as of April 2016.

the scripts uses:
pandas 0.18
qt 4.8.7
qtpy 1.0

YunliuStorage
import pandas as pd
import numpy as np
from PyQt4 import QtCore, QtGui
import sys
import re

class mainWgt(QtGui.QMainWindow):

    def __init__(self):

        # regex stuff
        rex = re.compile('(?<=ss)\d+')
        match = rex.search('ss23423').group(0)

        # Pandas stuff
        self.df = pd.DataFrame(data=np.random.randn(100, 10))
        self.df[4] = self.df[1] + self.df[2]
        self.df[5] = self.df.apply(lambda x: '{}_{}'.format(x[1], x[2]), axis=1)

        # PyQt stuff
        super().__init__()
        self.resize(1000, 1000)
        self.rootWgt = QtGui.QWidget(self)
        self.table = QtGui.QTableWidget(self.rootWgt)
        self.rootWgt_lay = QtGui.QGridLayout(self.rootWgt)
        self.rootWgt_lay.addWidget(self.table, 0, 0, 1, 1)
        self.setCentralWidget(self.rootWgt)
        self.table.setColumnCount(11)
        self.table.setRowCount(111)

        # all together
        self.table.setItem(0, 0, QtGui.QTableWidgetItem())
        self.table.item(0,0).setText(match)
        for i in self.df:
            for j, item in enumerate(self.df[i]):
                self.table.setItem(j, i, QtGui.QTableWidgetItem())
                self.table.item(j, i).setText(str(item))
#} ^ class mainWgt(QtGui.QMainWindow):

app = QtGui.QApplication(sys.argv)
gui = mainWgt()
gui.show()
sys.exit(app.exec_())

Here is a short sample code involving qtpy and pandas.

I can compile this code with default download from anaconda64 for windows and pycharm community edition, all downloaded on 2016-04-07:

[0] install Anaconda64 for windows without prior install of python. As time of writting, Anaconda by default will install both 3.4.3 and 3.5.1 environment. But that does not cause any grief for me in the following steps.
[1] cmd: pip install pyinstaller, pip install can detect Anaconda's python.
[2] revert package "setuptools" to 19.2. I did that in pycharm (Settings, Project:, Project Interpreter) [3] follow instructions how to use pyinstaller, everything from here should be google-able

Caveat: the result is a 200MB 3000+ files folder. If you just want a quick exe to do some small chores, stay away from big packages. Pandas is at its best in its scripting form.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Pyinstaller - Python exe when run shows error "Failed to execute script pyi_rth_nltk"

python --> pyinstaller - .exe file will return "test returned -1"

PyInstaller exe returning error on a Tkinter script

Create .exe with Pyinstaller ERROR: Assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none not found

Pyinstaller with Anaconda 3 and Python 3.7 not working?

How to make a .exe from python script with pyinstaller?

boolean values, run time error if not 0 or 1

Error creating .exe (pyinstaller) with cloudscraper module [Python]

Python pyinstaller error when converting py to exe

How to schedule python script run from anaconda?

no module named error after pyinstaller python script

Can not run .exe packed by pyinstaller

Exe to python with pyinstaller?

Creating .exe for python script error

Pyinstaller exe failed to execute script

PyInstaller Exe behaves differently to script

awk: run time error: negative field index $-1

How To Run MPI Python Script across multiple nodes on Slurm cluster? Error: Warning: can't run 1 processes on 2 nodes, setting nnodes to 1

Run script at specific time with Python

Run 1 function of bash script

PyInstaller exe gives cython error

Run Python Script from VBA - iwshshell3 error

Pyinstaller gives " 'chromedriver.exe' executable needs to be in PATH" when the .exe is ran, but the actual python script works fine

Creating a .exe from a python script which runs a separate python script using pyinstaller

Error "%1 is not a valid Win32 application" when starting IPython Notebook (Anaconda 3)

Try to run a sample code but got "collect2.exe: error: ld returned 1 exit status"

Why FormulaR1C1 does occure Run-time error '1004'

Lost my python.exe in Pycharm with Anaconda3

After applying code obfuscation exe take 1-3 minutes to run