Cell Profiler crashing, guessing python error

I’m getting a crash when starting CP with the following alert window:

I"m running Mac OSX 10.6.7 with build 10667 of CP, something I might mention is that I just installed XCode 4.0.2 with iOS SDK 4.3 and this may have modified python (it’s possible but not probable)

Here’s the pertinent messages from the console:

May 4 11:18:10 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: Traceback (most recent call last): May 4 11:18:10 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/cc/release_10953/CellProfiler/cellprofiler/modules/__init__.py", line 313, in add_module May 4 11:18:10 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/cc/release_10953/CellProfiler/cellprofiler/cpmodule.py", line 90, in __init__ May 4 11:18:10 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/cc/release_10953/CellProfiler/cellprofiler/modules/createbatchfiles.py", line 94, in create_settings May 4 11:18:10 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/cc/release_10953/CellProfiler/cellprofiler/preferences.py", line 200, in get_default_image_directory May 4 11:18:10 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: TypeError: encode() argument 1 must be string, not None May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: None May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: could not load these modules ('cellprofiler.modules.createbatchfiles', TypeError('encode() argument 1 must be string, not None',))] May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: Traceback (most recent call last): May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/Applications/CellProfiler2.0.app/Contents/Resources/__boot__.py", line 162, in <module> May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: _run('CellProfiler.py') May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/Applications/CellProfiler2.0.app/Contents/Resources/__boot__.py", line 134, in _run May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: execfile(path, globals(), globals()) May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/Applications/CellProfiler2.0.app/Contents/Resources/CellProfiler.py", line 224, in <module> May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: show_splashbox = True) May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/cc/release_10953/CellProfiler/cellprofiler/cellprofilerapp.py", line 16, in __init__ May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "wx/_core.pyc", line 7978, in __init__ May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "wx/_core.pyc", line 7552, in _BootstrapApp May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/cc/release_10953/CellProfiler/cellprofiler/cellprofilerapp.py", line 42, in OnInit May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/cc/release_10953/CellProfiler/cellprofiler/gui/cpframe.py", line 142, in __init__ May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/cc/release_10953/CellProfiler/cellprofiler/gui/cpframe.py", line 583, in __attach_views May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/cc/release_10953/CellProfiler/cellprofiler/gui/preferencesview.py", line 38, in __init__ May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: File "/cc/release_10953/CellProfiler/cellprofiler/preferences.py", line 200, in get_default_image_directory May 4 11:18:12 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: TypeError: encode() argument 1 must be string, not None May 4 11:18:12 dhcp-10-134-220-169 CellProfiler2.0[361]: CellProfiler2.0 Error May 4 11:18:45: --- last message repeated 1 time --- May 4 11:18:45 dhcp-10-134-220-169 [0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]: Must detach at exit May 4 11:18:45 dhcp-10-134-220-169 com.apple.launchd.peruser.501[179] ([0x0-0x2c02c].org.pythonmac.unspecified.CellProfiler2.0[361]): Exited with exit code: 255

Hi Scott,

This is something we have noticed ourselves, enough to make it worthy of a FAQ item. If you uninstall and download/install a fresh download of v10997, it should work (but let us know if it doesn’t!).

Regards,
-Mark

Thanks, I actually did put CP in the trash (the equivalent of uninstalling in Mac OS X) and then extracted a new CP into the Apps folder. It didn’t work. However, a simpler solution turned out to be just reverting the folder name that I had changed to its old title. That worked. I’ll just have to remember to change the working directory to something else before doing any renaming of folders.

Thanks for the help as always.

Good to know. I’ll put a note in the FAQ about restoring the drive as another workaround.
-Mark

Ok, I’m getting the same crash again. I don’t remember the old directory it was set to so I can’t do that workaround. I’ve tried uninstalling and reinstalling CellProfiler and that didn’t work. Should I try reinstalling Python?

Well, I found the solution… this is what I did:

  1. Uninstalled MacPython per macpython.org’s uninstallation directions
  2. Deleted CP and CPA
  3. Emptied the trashcan
  4. Restarted (even though its a Mac and shouldn’t matter)
  5. Re-downloaded Python 2.7.2, CP
  6. Re-installed Python and CP and it worked :smile:

Thanks for the heads-up. I’ll add these comments to the FAQ!
-Mark