Win exe build wx error

wx
build
source
error

#1

Following the build of the latest release for windows, executable crashes and “CellProfiler-Analyst.exe.log” is as:

Traceback (most recent call last):
File “CellProfiler-Analyst.py”, line 22, in
File “cpa\helpmenu.pyc”, line 3, in

File “cpa\icons_init_.pyc”, line 20, in

wx._core.PyNoAppError: The wx.App object must be created first!

I have read this may be related to confilcts with the native Python GUI, but it is not immediately obvious where the error lies when following the traceback.

Any suggestions?


#2

Hi,

Which exact version of CPA were you trying to install? More details would be helpful in troubleshooting this. Thanks.


#3

The latest version on GitHub - 2.2.1


#4

The nightly or the stable? Are you installing from source or the executable? Thanks.


#5

Building from source downloaded from cell-profiler analyst github repo, which according to the readme.md is ver 2.2.1 (stable) with no mention of nightly version inclusion. Using “setup_py2exe.py” on Windows 10 with all required python and JDK dependancies.


#6

Hmm, I’m confused; setup_py2exe.py is designed to be run on a Mac, not on a Windows machine. Did you mean perhaps CellProfiler-Analyst.py

In any case, I’m not seeing the same error you do when I run from source or compiled on my Windows machine. It’s possible you’re missing a required dependency- can you post the output of pip freeze and java -version? Also, sometimes wx apparently doesn’t play nicely with conda; are you using stock python or Conda?

If you just want to run the stable (not the master branch) can you just try using the compiled version available on our website?


#7

It was my understanding that the py2exe module could not be run on macs, so I have not pursued that further, however I do recall getting an error regarding missing Windows headers.

Also, my team informed me that other groups reported that building from source may be beneficial as some functions that otherwise fail to work (when using the provided compiled executable) become usable. I cannot elaborate on which functions they were referring to.

Below is my Win10 java version and pip freeze:

java version "1.8.0_144"
Java™ SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot™ 64-Bit Server VM (build 25.144-b01, mixed mode)

C:\Users\User>pip freeze
cycler==0.10.0
decorator==4.1.2
funcsigs==1.0.2
functools32==3.2.3.post2
future==0.16.0
javabridge==1.0.15
matplotlib==2.0.2
mock==2.0.0
networkx==2.0
numpy==1.13.1+mkl
olefile==0.44
pbr==3.1.1
Pillow==4.2.1
py2exe==0.6.9
pyparsing==2.2.0
python-bioformats==1.3.1
python-dateutil==2.6.1
pytz==2017.2
PyWavelets==0.5.2
scikit-image==0.13.0
scikit-learn==0.18.2
scipy==0.19.1
six==1.11.0
verlib==0.1
wxPython==4.0.0b2


#8

Looks like your wx is ahead of ours. Do you need 4.0.0 for anything else? If not, I recommend uninstalling your current version and installing the wheels for 3.0 and common_3.0 from here.

If you do need wx4 for something, and/or if you just don’t want to deal with this anymore, I definitely recommend the stable pre-compiled; you can always come back to this if you need a functionality that’s in the current master but not in 2.2.1, but there aren’t a ton cases where that’s true. Generally the stuff that’s not in the release version is more “nice to have” than “required for function”.