diff --git a/pmag_gui.spec b/pmag_gui.spec new file mode 100644 index 0000000..3fdb494 --- /dev/null +++ b/pmag_gui.spec @@ -0,0 +1,53 @@ +# -*- mode: python -*- + +# this is an example.spec file + +import os +import sys +from pmagpy import version +sys.setrecursionlimit(30000) +app_name = "pmag_gui_{}".format(version.version[7:]) +current_dir = os.getcwd() + +block_cipher = None + +files = [('{}/pmagpy/data_model/*.json'.format(current_dir), './pmagpy/data_model/'), + ('{}/dialogs/help_files/*.html'.format(current_dir), './dialogs/help_files') + ] + + +a = Analysis(['programs/pmag_gui.py'], + pathex=[current_dir], + binaries=[], + datas=files, + hiddenimports=['scipy.odr', 'scipy.io', 'scipy.fftpack', + 'scipy.cluster','scipy.optimize', 'scipy.interpolate', + 'scipy._lib.messagestream', 'scipy.datasets', 'scipy.misc', + # timdeltas appears necessary for Windows with + # conda-installed pyinstaller + 'pandas._libs.tslibs.timedeltas', + 'pandas.concat', 'wget', 'pkg_resources.py2_warn'], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + #name='pmag_gui', + name=app_name, + debug=False, + strip=False, + upx=True, + console=False, icon='./programs/images/PmagPy.ico') +app = BUNDLE(exe, + #name='pmag_gui.app', + name=app_name + ".app", + icon='./programs/images/PmagPy.ico', + bundle_identifier=None) diff --git a/setup_scripts.md b/setup_scripts.md new file mode 100644 index 0000000..75c3ec7 --- /dev/null +++ b/setup_scripts.md @@ -0,0 +1,25 @@ +## A workflow that worked on 2/16/2023 for Yiming Zhang for Windows 10 + +Made a new conda enviroment + +```conda create -n pmag_gui_compile python=3.9.13``` + +Activated that conda environment: + +```conda activate pmag_gui_compile``` + +```conda install future matplotlib numpy scipy pandas``` + +- Use pip to install wxPython + - `pip install --upgrade -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython` + +- Use pip to install Pyinstaller + - `pip install git+https://github.com/pyinstaller/pyinstaller.git` + +Compiled the program: + +```pyinstaller pmag_gui.spec``` + + + +I used essentially the same pmag_gui.spec in the ```PmagPy``` repository to generate the executable file. Minor changes were necessary in the ```hiddenimports``` section where I had to add a few scipy modules in order for the excutable to initialize without crashing. That version of .spec file is saved here. \ No newline at end of file