KeyError: 'microscopes_16' when trying to run CellProfiler 4.0.3 on Windows

With a fresh installation of CellProfiler 4.0.3 on a Windows 10 system, I get the following error:

Starting CellProfiler 4.0.3
Traceback (most recent call last):
  File "cellprofiler\icons\__init__.py", line 17, in get_builtin_image
  File "c:\hostedtoolcache\windows\python\3.8.5\x64\lib\weakref.py", line 131, in __getitem__
KeyError: 'microscopes_16'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "cellprofiler\gui\app.py", line 57, in OnInit
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "d:\a\cellprofiler\cellprofiler\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "cellprofiler\gui\cpframe.py", line 33, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "d:\a\cellprofiler\cellprofiler\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "cellprofiler\gui\module_view\__init__.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "d:\a\cellprofiler\cellprofiler\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "cellprofiler\gui\module_view\_module_view.py", line 68, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "d:\a\cellprofiler\cellprofiler\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "cellprofiler\gui\module_view\_file_collection_display_controller.py", line 15, in <module>
  File "cellprofiler\gui\module_view\_file_collection_display_controller.py", line 53, in FileCollectionDisplayController
  File "cellprofiler\icons\__init__.py", line 21, in get_builtin_image
wx._core.wxAssertionError: C++ assertion "strcmp(setlocale(0, 0), "C") == 0" failed at ..\..\src\common\intl.cpp(1699) in wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now there is a mismatch between C/C++ and Windows locale.
Things are going to break, please only change locale by creating wxLocale objects to avoid this!
OnInit returned false, exiting...

Did anyone else encounter this issue, and maybe found a solution? It currently prevents me from using CellProfiler at all.

Sorry about that, we’re aware of this and should have a fix in 4.0.4 this week.

If you need a temporary workaround you could try setting your system locale/time format to English (if it isn’t already), but that’s not ideal.

1 Like

Update: 4.0.4 has now been released and is available on the website. This should have resolved this issue.

1 Like