Problems Implementing New Module


Hi CellProfiler Development Team,

I am currently using CellProfiler 2.2.0, and I am trying to import Python code for a new module that was shared on Github. I know this has been addressed in other posts, but I’m still encountering issues even after implementing methods that have solved this problem for others on the forum. The main approach I’ve been trying is saving the code to the plugins folder under cellprofiler/modules (which I have listed as my directory for CellProfiler plugins under Preferences) and opening a new session of Cellprofiler. The module I’ve added (plus other Python code that was automatically included in the plugins folder upon installation) does not show up in my module list. I have tried other tangentially-related fixes that I encountered in the forum (I’ll refrain from listing them all to try to be concise), but still no luck. If there are any other suggestions as to the source of the problem and related solutions, they would be most appreciated.



@tmh263, your configuration of CellProfiler plugins sounds correct. Would you please try to configure a different plugin and report back what you find? Please visit the CellProfiler plugins Github repository to find a plugin to try. If you still cannot find the different plugin, then this would require further CellProfiler troubleshooting. If you can find the different plugin, then your original plugin will need troubleshooting.


Thank you for the suggestion. I took the measure radial entropy python code from the repository you have suggested, and I moved it into my plugins folder under cellprofiler/modules while CellProfiler was closed. I then started CellProfiler and double checked the Plugins directory matched to the path that I saved the python code to. Upon restarting CellProfiler after doing all of this, I still am unable to access the plugin. Any suggestions for troubleshooting?


I just tried this, and there seems to be an error thrown in MeasureRadialEntropy when run as a plugin; I’ll try to debug that and get a new version pushed.


Please also try the nightly version of CellProfiler.


@karhohs is correct and I was not; I thought this module had been tested for compatibility with CellProfiler 2.2 but I was wrong; you’ll want to use CellProfiler 3.0 to run it.


I tried downloading the nightly version, but still no luck. Could it possibly be that I am missing one of the software packages specified on the Source Installation page? Or is this version well-equipped recognize the plugin as is once imported into the appropriate directory? I can go back through and see if I am indeed missing anything, but I thought I’d try to narrow down the potential source of problem as much as possible.


Are you on Windows or Mac?

On Mac as far as I know it should work in the nightly, please report your CP version (at the top of the window) and the error you’re getting if it doesn’t. (In the black console window you’ll see something like the following)

Could not load measureradialentropy
Traceback (most recent call last):
  File "cellprofiler\modules\__init__.pyc", line 294, in add_module
  File "C:\Program Files\CellProfiler22\cellprofiler\modules\plugins\", line 15, in <module>
ImportError: No module named module

For Windows the nightly build has unfortunately been broken for a while so you’d need to install from source to get 3.0; if your analysis isn’t super urgent we’re hoping to have nightly builds fixed for Windows in the next couple of weeks, so if you don’t want to have to build from source you can stay tuned for that.


I’m on Windows. After downloading the nightly version (2.4.0rc21) and going through the same procedure that I listed in my original post, I find that I am getting the same error that you posted:

Could not load measureradialentropy
Traceback (most recent call last):
  File "cellprofiler\modules\__init__.pyc", line 301, in add_module
  File "C:\Program Files\CellProfiler\cellprofiler\modules\plugins\", line 17, in <module>
ImportError: No module named module
could not load these modules: measureradialentropy

Would this be a function of the nightly build being broken?


Yes, because the nightly build that’s up there is CP 2.4.0, you need CP 3.0 to run the plugin. You can either install that from source now according to the procedure in the link I just posted OR wait a week or two until we fix Windows nightly builds and then download and install a new one. Does that make sense?


Yes that makes sense, thank you for clarifying. I’ll try the source installation in the meantime.