Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in importing "_cpmorphology" module #3

Open
zhouhao-learning opened this issue Oct 11, 2018 · 2 comments
Open

Error in importing "_cpmorphology" module #3

zhouhao-learning opened this issue Oct 11, 2018 · 2 comments

Comments

@zhouhao-learning
Copy link

I'm trying to run your Processplate. sh file, but I encountered a module import error in the CellProfiler / cellprofiler / cpmath / cpmorphology. py file. The cpmorphology. py file imported itself as a module, but I couldn't run it. I got the following error:

Traceback (most recent call last):
  File "./CellProfiler/CellProfiler.py", line 252, in main
    run_pipeline_headless(options, args)
  File "./CellProfiler/CellProfiler.py", line 790, in run_pipeline_headless
    from cellprofiler.pipeline import Pipeline, EXIT_STATUS, M_PIPELINE
  File "/project/hit_cell/process-plate/CellProfiler/cellprofiler/pipeline.py", line 52, in <module>
    import cellprofiler.objects as cpo
  File "/project/hit_cell/process-plate/CellProfiler/cellprofiler/objects.py", line 19, in <module>
    from cellprofiler.cpmath.cpmorphology import all_connected_components
  File "/project/hit_cell/process-plate/CellProfiler/cellprofiler/cpmath/cpmorphology.py", line 20, in <module>
    import _cpmorphology
ImportError: No module named _cpmorphology

Similar modules are from _cpmorphology2 import skeletonize_loop, table_lookup_index, but I don't see a cpmorphology2.py file, just see a _cpmorphology2.pyx file

What should I do with this error? Thank you very much.

@roelWuyts
Copy link
Contributor

It is a CellProfiler error that I cannot remember seeing.

However I have added some more instructions and files to get CellProfiler 2.1.1 running correctly. Can you check out the latest release of process-plate and follow the instructions in the readme (both installing the missing dependencies and then initializing CellProfiler) ? That may solve the import problems.

@zhouhao-learning
Copy link
Author

@roelWuyts
Hello, I started again according to the content of your updated document, and I got the following error during the same period:

Traceback (most recent call last):
  File "./CellProfiler/CellProfiler.py", line 249, in main
    run_pipeline_headless(options, args)
  File "./CellProfiler/CellProfiler.py", line 787, in run_pipeline_headless
    from cellprofiler.pipeline import Pipeline, EXIT_STATUS, M_PIPELINE
  File "/project/hit_cell/test/process-plate/CellProfiler/cellprofiler/pipeline.py", line 58, in <module>
    from bioformats.omexml import OMEXML
  File "/project/hit_cell/test/process-plate/CellProfiler/bioformats/__init__.py", line 150, in <module>
    start_cellprofiler_jvm()
  File "/project/hit_cell/test/process-plate/CellProfiler/bioformats/__init__.py", line 68, in start_cellprofiler_jvm
    jar_files = get_cellprofiler_jars()
  File "/project/hit_cell/test/process-plate/CellProfiler/external_dependencies.py", line 315, in get_cellprofiler_jars
    "Can't determine CellProfiler java dependencies because %s is missing. Please re-run external_dependencies with the -o switch" % path)
RuntimeError: Can't determine CellProfiler java dependencies because /project/hit_cell/test/process-plate/CellProfiler/imagej/jars/cellprofiler-dependencies-classpath.txt is missing. Please re-run external_dependencies with the -o switch
Failed to stop Ilastik
Failed to stop the JVM

And I didn't produce the CellProfiler / ImageJ / jars / cellprofiler - dependencies - classpath. txt file mentioned in the error when I did it your way.

Then I rerun Python Cell Profiler / Cell Profiler. py -- build - and - exit to get a lot of errors, some of which are as follows:

Traceback (most recent call last):
  File "/project/hit_cell/test/process-plate/CellProfiler/external_dependencies.py", line 142, in fetch_external_dependencies
    fetchfile(path, url)
  File "/project/hit_cell/test/process-plate/CellProfiler/external_dependencies.py", line 106, in fetchfile
    src = urllib2.urlopen(url)
  File "/home/zh/anaconda2/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/home/zh/anaconda2/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/home/zh/anaconda2/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/home/zh/anaconda2/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/home/zh/anaconda2/lib/python2.7/urllib2.py", line 1336, in file_open
    return self.open_local_file(req)
  File "/home/zh/anaconda2/lib/python2.7/urllib2.py", line 1376, in open_local_file
    raise URLError(msg)
URLError: <urlopen error [Errno 2] No such file or directory: '/CP/dependencies/apache-maven-3.0.4-bin.zip'>
Could not fetch external binary dependency /project/hit_cell/test/process-plate/CellProfiler/imagej/apache-maven-3.0.4-bin.zip from file:///CP/dependencies/apache-maven-3.0.4-bin.zip.  Some functionality may be missing.  You might try installing it by hand.
fetching file:///CP/dependencies/blitz.jar to /project/hit_cell/test/process-plate/CellProfiler/imagej/jars/blitz.jar

What should I do? Why do you have no problem there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants