-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add readme file describing what worked for Windows pmag_gui standalone
the .spec file is modified and works for windows set_scripts is the readme file that describes the workflow
- Loading branch information
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |