No module named 'javabridge._javabridge' build Cellprofiler Analyst from source code

I came across this error when trying to score all images:

TypeError: ufunc 'isinf' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule "safe"

This issue is fixed in the CPA source code but the latest version doesn’t contain the fixed code. I tried to download the python file and generate a pyc file to replace the old one, but it doesn’t work. So it seems that my only option is to build from the source code.

I installed all required packages and run “python”, then it gives me the following error:

Traceback (most recent call last):
  File "C:\Users\17062\Downloads\CellProfiler-Analyst-master\", line 19, in <module>
    import javabridge
  File "C:\Users\17062\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\javabridge\", line 38, in <module>
    from .jutil import start_vm, kill_vm, vm, activate_awt, deactivate_awt
  File "C:\Users\17062\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\javabridge\", line 157, in <module>
    import javabridge._javabridge as _javabridge
ModuleNotFoundError: No module named 'javabridge._javabridge'

The version of my javabridge is 1.0.16. I tried to uninstall and install it but it didn’t work.
How to fix this issue?

record of my progress
I found my javabridge is not the latest version. I tried to update it but failed because of a lack of “io.h”. After I downloaded the visualcppbuildtools, I can update the javabridge and fix the issue.

Then, I run python in cmd
and constantly get ModuleNotFoundError: No module named 'XXX'.
This code
set PYTHONPATH=.;./cpa;./cpa/gui;./cpa/profiling;./cpa/profiling/tests;./cpa/tests;./cpa/util can fix this issue.

Now I need to install wxPython3.0.2.0. The wheel link available in the forum is for python 2 as indicated in the name and I can’t find wxPython3 for python 3. Therefore I am installing python 2.7 now. It would be a lot easier if I am using python 2 from the beginning.

I’m not certain how easy it will be to find many of the packages CPA needs, now that Python 2.7 has been end-of-life-d; if there is any chance you can just get away with using FastGentleBoosting rather than another classifier, I strongly recommend you do that.

CellProfiler-Analyst is an unfunded piece of software, which is why its updates often lag behind things like CellProfiler, but we’re hoping to be able to upgrade it to Python3 and put out a new release of it later this year.

Thank you. FastGentleBoosting works.
I downloaded python2 and found that I need to install all packages again. Javabridge is not supported by python2, so I stopped here.

Try the binaries at Python Extension Packages for Windows - Christoph Gohlke.