I'm using Python 3.9 on a Mac running Big Sur and am trying to create an app, MyApplication_6_14.app, from a script using py2app. I'm following the process outlined at https://py2app.readthedocs.io/en/latest/tutorial.html .
I have no problems developing and running the app with alias mode and no error messages result when I build for deployment. However, when I try to run the final app from the command line, I obtain the following length error message:
Traceback (most recent call last): File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_14.app/Contents/Resources/__boot__.py", line 115, in <module> _run() File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_14.app/Contents/Resources/__boot__.py", line 84, in _run exec(compile(source, path, "exec"), globals(), globals()) File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_14.app/Contents/Resources/MyApplication_6_14.py", line 7, in <module> import pandas as pd File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_14.app/Contents/Resources/lib/python3.9/pandas/__init__.py", line 179, in <module> import pandas.testing File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_14.app/Contents/Resources/lib/python3.9/pandas/testing.py", line 5, in <module> from pandas._testing import ( File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_14.app/Contents/Resources/lib/python3.9/pandas/_testing.py", line 29, in <module> import pandas._libs.testing as _testing File "pandas/_libs/testing.pyx", line 1, in init pandas._libs.testing ValueError: source code string cannot contain null bytes
My setup file looks as follows, where I've included pandas and cmath as package options due to previous error messages:
from setuptools import setup
APP = ['MyApplication_6_14.py']
DATA_FILES = []
OPTIONS = {'resources':['background.png'],'packages': ['pandas','cmath']}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)