Error running an exe file in Windows with reportlab import
Ernest Bonat, Ph.D.
ernest.bonat at gmail.com
Fri Aug 12 19:52:30 EDT 2016
I have created a simple Python program including the following packages:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from reportlab.pdfgen import canvas
if __name__ == '__main__':
print("Hi!")
I have created the installation package (PyInstaller) using the following
command line:
pyinstaller --onedir --name=runatestapp --noupx
"C:\Users\Ernest\workspace\bars\src\run_a_test.py"
The required folders (build and dist) and the spec file are created
properly with no errors. When I run the runatestapp.exe file in the command
prompt I got the error "Failed to execute script run_a_test".
I'm using the following software versions now:
Anaconda3 4.1.1.64-bit
Python 3.5.2
PyInstaller 3.2
Windows 10 64-bit
Here is the Traceback info
Traceback (most recent call last):
File "run_a_test.py", line 4, in <module>
from reportlab.pdfgen import canvas
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in
_load_backward_compatible
File
"C:\Users\Ernest\AppData\Local\Continuum\lib\site-packages\PyInstaller\loader\pyimo
d03_importers.py", line 389, in load_module
exec(bytecode, module.__dict__)
File "site-packages\reportlab\pdfgen\canvas.py", line 19, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in
_load_backward_compatible
File
"C:\Users\Ernest\AppData\Local\Continuum\lib\site-packages\PyInstaller\loader\pyimo
d03_importers.py", line 389, in load_module
exec(bytecode, module.__dict__)
File "site-packages\reportlab\rl_config.py", line 131, in <module>
File "site-packages\reportlab\rl_config.py", line 102, in _startUp
File "site-packages\reportlab\lib\utils.py", line 695, in rl_isdir
AttributeError: 'FrozenImporter' object has no attribute '_files'
Failed to execute script run_a_test
Any help is much appreciated. Feel free to contact me at any time you need.
Thank you,
Ernest Bonat, Ph.D.
Senior Software Engineer
Senior Data Scientist
More information about the Python-list
mailing list