Cellprofiler: Pin dependencies for stable branch

Created on 4 Feb 2018  路  6Comments  路  Source: CellProfiler/CellProfiler

Hi,

I've been running into a number of different issues trying to install CellProfiler in different ways. I'm not sure if they're related, but I'm posting them here in one thread in hopes of elucidating the issue.

Note: I'm running Python2.7 and Ubuntu 16.04.

First method (installing from PyPl):

pip install --pre --user cellprofiler
cellprofiler
Traceback (most recent call last):
  File "/home/ben/.local/bin/cellprofiler", line 11, in <module>
    sys.exit(main())
  File "/home/ben/.local/lib/python2.7/site-packages/cellprofiler/__main__.py", line 152, in main
    app = cellprofiler.gui.app.App(0, workspace_path=workspace_path, pipeline_path=pipeline_path)
  File "/home/ben/.local/lib/python2.7/site-packages/cellprofiler/gui/app.py", line 55, in __init__
    super(App, self).__init__(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/wx/_core.py", line 8628, in __init__
    self._BootstrapApp()
  File "/usr/lib/python2.7/dist-packages/wx/_core.py", line 8196, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "/home/ben/.local/lib/python2.7/site-packages/cellprofiler/gui/app.py", line 58, in OnInit
    import cellprofiler.gui.cpframe
  File "/home/ben/.local/lib/python2.7/site-packages/cellprofiler/gui/cpframe.py", line 8, in <module>
    import cellprofiler.gui.datatoolframe
  File "/home/ben/.local/lib/python2.7/site-packages/cellprofiler/gui/datatoolframe.py", line 8, in <module>
    import cellprofiler.gui.moduleview
  File "/home/ben/.local/lib/python2.7/site-packages/cellprofiler/gui/moduleview.py", line 2818, in <module>
    class FileCollectionDisplayController(object):
  File "/home/ben/.local/lib/python2.7/site-packages/cellprofiler/gui/moduleview.py", line 2852, in FileCollectionDisplayController
    cellprofiler.icons.get_builtin_image("microscope-icon_16").ConvertToBitmap())
  File "/usr/lib/python2.7/dist-packages/wx/_core.py", line 3646, in ConvertToBitmap
    return _core_.Image_ConvertToBitmap(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "image.IsOk()" failed at ../src/gtk/bitmap.cpp(626) in wxBitmap(): invalid image

Second Method (install master branch from git):

pip install --user --editable .
cellprofiler
(cellprofiler:8867): Gdk-WARNING **: gdk_window_set_icon_list: icons too large
Traceback (most recent call last):
  File "/home/ben/.local/bin/cellprofiler", line 11, in <module>
    load_entry_point('CellProfiler', 'console_scripts', 'cellprofiler')()
  File "/home/ben/repos/CellProfiler/cellprofiler/__main__.py", line 152, in main
    app = cellprofiler.gui.app.App(0, workspace_path=workspace_path, pipeline_path=pipeline_path)
  File "/home/ben/repos/CellProfiler/cellprofiler/gui/app.py", line 55, in __init__
    super(App, self).__init__(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/wx/_core.py", line 8628, in __init__
    self._BootstrapApp()
  File "/usr/lib/python2.7/dist-packages/wx/_core.py", line 8196, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "/home/ben/repos/CellProfiler/cellprofiler/gui/app.py", line 64, in OnInit
    self.frame.start(self.workspace_path, self.pipeline_path)
  File "/home/ben/repos/CellProfiler/cellprofiler/gui/cpframe.py", line 350, in start
    self.__pipeline_controller.start(workspace_path, pipeline_path)
  File "/home/ben/repos/CellProfiler/cellprofiler/gui/pipelinecontroller.py", line 191, in start
    self.do_create_workspace()
  File "/home/ben/repos/CellProfiler/cellprofiler/gui/pipelinecontroller.py", line 657, in do_create_workspace
    self.__pipeline.clear()
  File "/home/ben/repos/CellProfiler/cellprofiler/pipeline.py", line 2382, in clear
    self.notify_listeners(PipelineClearedEvent())
  File "/home/ben/repos/CellProfiler/cellprofiler/pipeline.py", line 3188, in notify_listeners
    listener(self, event)
  File "/home/ben/repos/CellProfiler/cellprofiler/gui/pipelinecontroller.py", line 1421, in __on_pipeline_event
    self.on_image_set_modification()
  File "/home/ben/repos/CellProfiler/cellprofiler/gui/pipelinecontroller.py", line 1432, in on_image_set_modification
    self.__workspace.invalidate_image_set()
  File "/home/ben/repos/CellProfiler/cellprofiler/workspace.py", line 497, in invalidate_image_set
    self.save_pipeline_to_measurements()
  File "/home/ben/repos/CellProfiler/cellprofiler/workspace.py", line 480, in save_pipeline_to_measurements
    self.measurements.add_experiment_measurement(M_PIPELINE, fd.getvalue())
  File "/home/ben/repos/CellProfiler/cellprofiler/measurement.py", line 522, in add_experiment_measurement
    self.hdf5_dict.add_all(EXPERIMENT, feature_name, [data], [0])
  File "/home/ben/repos/CellProfiler/cellprofiler/utilities/hdf5_dict.py", line 792, in add_all
    maxshape=(None, 3))
  File "/usr/lib/python2.7/dist-packages/h5py/_hl/group.py", line 105, in create_dataset
    dsid = dataset.make_new_dset(self, shape, dtype, data, **kwds)
  File "/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.py", line 76, in make_new_dset
    if isinstance(chunks, tuple) and (-numpy.array([ i>=j for i,j in zip(tmp_shape,chunks) if i is not None])).any():
TypeError: The numpy boolean negative, the `-` operator, is not supported, use the `~` operator or the logical_not function instead.

Third Method (installing stable branch from git):

pip install --user --editable .
cellprofiler
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xa
Traceback (most recent call last):
  File "/home/ben/.local/bin/cellprofiler", line 11, in <module>
    load_entry_point('CellProfiler', 'console_scripts', 'cellprofiler')()
  File "/home/ben/repos/CellProfiler/cellprofiler/__main__.py", line 175, in main
    from cellprofiler.utilities.cpjvm import cp_start_vm
  File "/home/ben/repos/CellProfiler/cellprofiler/utilities/cpjvm.py", line 3, in <module>
    import javabridge
  File "/usr/local/lib/python2.7/dist-packages/javabridge/__init__.py", line 38, in <module>
    from .jutil import start_vm, kill_vm, vm, activate_awt, deactivate_awt
  File "/usr/local/lib/python2.7/dist-packages/javabridge/jutil.py", line 157, in <module>
    import javabridge._javabridge as _javabridge
ImportError: numpy.core.multiarray failed to import

This last error, I believe, is caused by a conflict of numpy and javabridge versions. When I install the stable branch of cellprofiler via pip, it reverts my version of numpy to 1.11.3, which is apparently not the version used to compile javabridge (1.0.15).

I've been trying to figure these issues out for a while now, but can't seem to make it beyond this point for any of these installation methods. Any help would be greatly appreciated! Thanks!

Bug

Most helpful comment

Update:

I managed to successfully install via the second method (the master branch of git) after updating h5py (from 2.6.0 to 2.7.1).

All 6 comments

Here are some relevant module versions from my pip freeze output (I tried to prune just those that might be relevant, but I can post the entire pip freeze if needed).

chardet==2.3.0
Cython==0.26
h5py==2.6.0
javabridge==1.0.15
matplotlib==2.1.2
MySQL-python==1.2.5
mysqlclient==1.3.7
nose==1.3.7
numpy==1.14.0
pandas==0.17.1
Pillow==3.1.2
python-bioformats==1.3.1
pyzmq==15.3.0
raven==6.5.0
prokaryote==2.3.2
scikit-image==0.13.1
scikit-learn==0.18.2
scipy==0.17.0
seaborn==0.8.1
wxPython==3.0.2.0
wxPython-common==3.0.2.0

Update:

I managed to successfully install via the second method (the master branch of git) after updating h5py (from 2.6.0 to 2.7.1).

@bchidest I'm glad that worked for you! I noticed that your version of h5py differed from mine (I was also at 2.7.1) but I was building CP3 not CP2.2 so I didn't want to give you an improper suggestion.

I'll make sure that the proper h5py version is specified in the stable install for the future.

@AetherUnbound To clarify, I was building CP3 from the master branch, which is where I ran into the issue of h5py needing to be updated to 2.7.1.

I also need to build CP2.2 (from the stable branch) to run some older pipelines, but I'm still running into the version conflict with numpy 1.11.3 and javabridge 1.0.15 (or 1.0.14). CP2.2 seems to require numpy 1.11.3, which is an older version than what javabridge 1.0.15 is built with, causing a conflict. Do you know what version of javabridge is required for CP2.2?

Hi @bchidest, I'm glad to hear you successfully installed CP from source. We're always testing CellProfiler against the latest dependencies, I'll update the instructions on the wiki pages so that the --upgrade flag is passed to pip install.

Do you know what version of javabridge is required for CP2.2?

@AetherUnbound and I are looking into the required versions for CP2.2, and we'll pin them in the setup.py once they're confirmed. I've updated the title of this issue to reflect this, since it seems to be a good outcome from this conversation.

Closed via #3488

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bethac07 picture bethac07  路  9Comments

dlogan picture dlogan  路  9Comments

AetherUnbound picture AetherUnbound  路  4Comments

AnneCarpenter picture AnneCarpenter  路  9Comments

bethac07 picture bethac07  路  7Comments