CP3.0: ImportError: No module named cpmodule

cellprofiler

#1

After installing CP 3.0 my own plugins do not work. I get an error message " ImportError: No module named cpmodule". What should I use instead of import cellprofiler.cpmodule?


#2

Hi Petter! I believe this is now called cellprofiler.module.


#3

Yes, thanks Beth.

But then I get problems with other imports as well:

import cellprofiler.settings
import cellprofiler.cpimage
import cellprofiler.measurements


#4

Hi Petter,

Looking at this page:

settings is now setting
cpimage is now image
measurements is now measurement

ETA it looks like most of the renaming came in this commit, so if there are other imports giving you trouble this might help you to track down old vs new names.


#5

Now the imports work, but I still get some problems since I cannot find IO_FOLDER_CHOICE_HELP_TEXT in the new preferences.py

Also errors for:

from cellprofiler.gui.help import USING_METADATA_HELP_REF, USING_METADATA_GROUPING_HELP_REF, LOADING_IMAGE_SEQ_HELP_REF
ImportError: cannot import name USING_METADATA_HELP_REF

from cellprofiler.gui.help import PROTIP_RECOMEND_ICON, PROTIP_AVOID_ICON, TECH_NOTE_ICON
ImportError: cannot import name PROTIP_RECOMEND_ICON


#6

It looks like a lot of those have moved to cellprofiler.modules._help

FWIW, you can search any of these variables in the cellprofiler repo to see where they’re moved to now (see below).


#7

I have got it working now. Thanks, Beth!


#8

Impressed by your persistence!