Closed bethac07 closed 4 years ago
Sorry, this seems strange: if mahotas
imports OK when you run it on the shell, it seems that it should also work on from cellprofiler
Can you run:
import mahotas
mahotas.test()
? This may require pytest
to be available, so it may fail for that reason.
I definitely agree that it's weird! A second 20.04 user has confirmed it though, so whatever the error is, it's reproducible across machines.
Thanks so much for taking a look at all!
From the shell:
ubuntu@ip-XXXXXXXXX:~$ python3
Python 3.8.2 (default, Jul 16 2020, 14:00:26)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mahotas
>>> mahotas.test()
================================================================================================== test session starts ==================================================================================================
platform linux -- Python 3.8.2, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
rootdir: /home/ubuntu
collected 307 items
.local/lib/python3.8/site-packages/mahotas/tests/test_bbox.py ....... [ 2%]
.local/lib/python3.8/site-packages/mahotas/tests/test_bwperim.py . [ 2%]
.local/lib/python3.8/site-packages/mahotas/tests/test_center_of_mass.py ..... [ 4%]
.local/lib/python3.8/site-packages/mahotas/tests/test_citation.py . [ 4%]
.local/lib/python3.8/site-packages/mahotas/tests/test_close_holes.py . [ 4%]
.local/lib/python3.8/site-packages/mahotas/tests/test_colors.py ... [ 5%]
.local/lib/python3.8/site-packages/mahotas/tests/test_convolve.py ......................... [ 14%]
.local/lib/python3.8/site-packages/mahotas/tests/test_demos.py . [ 14%]
.local/lib/python3.8/site-packages/mahotas/tests/test_dilate_erode.py ........... [ 17%]
.local/lib/python3.8/site-packages/mahotas/tests/test_distance.py ... [ 18%]
.local/lib/python3.8/site-packages/mahotas/tests/test_edge.py ....... [ 21%]
.local/lib/python3.8/site-packages/mahotas/tests/test_euler.py ... [ 22%]
.local/lib/python3.8/site-packages/mahotas/tests/test_features_shape.py .... [ 23%]
.local/lib/python3.8/site-packages/mahotas/tests/test_filters.py ... [ 24%]
.local/lib/python3.8/site-packages/mahotas/tests/test_find.py .. [ 25%]
.local/lib/python3.8/site-packages/mahotas/tests/test_freeimage.py ssssssss [ 27%]
.local/lib/python3.8/site-packages/mahotas/tests/test_gvoronoi.py .. [ 28%]
.local/lib/python3.8/site-packages/mahotas/tests/test_histogram.py ..... [ 29%]
.local/lib/python3.8/site-packages/mahotas/tests/test_hitmiss.py ... [ 30%]
.local/lib/python3.8/site-packages/mahotas/tests/test_imresize.py ... [ 31%]
.local/lib/python3.8/site-packages/mahotas/tests/test_internal.py ............................. [ 41%]
.local/lib/python3.8/site-packages/mahotas/tests/test_interpolate.py ............. [ 45%]
.local/lib/python3.8/site-packages/mahotas/tests/test_io.py .... [ 46%]
.local/lib/python3.8/site-packages/mahotas/tests/test_label.py ... [ 47%]
.local/lib/python3.8/site-packages/mahotas/tests/test_labeled.py ................... [ 54%]
.local/lib/python3.8/site-packages/mahotas/tests/test_lbp.py .......... [ 57%]
.local/lib/python3.8/site-packages/mahotas/tests/test_mahotas.py . [ 57%]
.local/lib/python3.8/site-packages/mahotas/tests/test_majority.py ...... [ 59%]
.local/lib/python3.8/site-packages/mahotas/tests/test_mean_filter.py . [ 59%]
.local/lib/python3.8/site-packages/mahotas/tests/test_median_filter.py .... [ 61%]
.local/lib/python3.8/site-packages/mahotas/tests/test_moments.py ......... [ 64%]
.local/lib/python3.8/site-packages/mahotas/tests/test_morph.py ............. [ 68%]
.local/lib/python3.8/site-packages/mahotas/tests/test_polygon.py ......... [ 71%]
.local/lib/python3.8/site-packages/mahotas/tests/test_segmentation.py . [ 71%]
.local/lib/python3.8/site-packages/mahotas/tests/test_stretch.py ......... [ 74%]
.local/lib/python3.8/site-packages/mahotas/tests/test_surf.py .............. [ 79%]
.local/lib/python3.8/site-packages/mahotas/tests/test_surf_regression.py .. [ 79%]
.local/lib/python3.8/site-packages/mahotas/tests/test_tas.py ..... [ 81%]
.local/lib/python3.8/site-packages/mahotas/tests/test_template_match.py . [ 81%]
.local/lib/python3.8/site-packages/mahotas/tests/test_texture.py .................... [ 88%]
.local/lib/python3.8/site-packages/mahotas/tests/test_thin.py ..... [ 89%]
.local/lib/python3.8/site-packages/mahotas/tests/test_thresholding.py .......... [ 93%]
.local/lib/python3.8/site-packages/mahotas/tests/test_watershed.py .................. [ 99%]
.local/lib/python3.8/site-packages/mahotas/tests/test_zernike.py ... [100%]
=================================================================================================== warnings summary ====================================================================================================
.local/lib/python3.8/site-packages/mahotas/tests/test_convolve.py::test_center_decenter
.local/lib/python3.8/site-packages/mahotas/tests/test_convolve.py::test_center_border
.local/lib/python3.8/site-packages/mahotas/tests/test_convolve.py::test_center_wavelet_iwavelet_decenter
/home/ubuntu/.local/lib/python3.8/site-packages/mahotas/convolve.py:479: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
nimage[position] = f
.local/lib/python3.8/site-packages/mahotas/tests/test_convolve.py::test_center_decenter
.local/lib/python3.8/site-packages/mahotas/tests/test_convolve.py::test_center_wavelet_iwavelet_decenter
/home/ubuntu/.local/lib/python3.8/site-packages/mahotas/convolve.py:510: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
return w[position]
-- Docs: https://docs.pytest.org/en/stable/warnings.html
====================================================================================== 299 passed, 8 skipped, 5 warnings in 14.20s ======================================================================================
<ExitCode.OK: 0>
Thanks for the test outputs. I think from mahotas
' POV, everything is working so I am closing here
I think this is more likely a CellProfiler issue or a "missing ubuntu library" issue, but as I'm less familiar with mahotas import errors hoping the solution will be obvious to someone here. Otherwise, feel free to close.
Detailed here, but I set up a clean AWS Ubuntu 20.04 instance to run some tests per these instructions. Mahotas seems to install fine, and the following runs without error in python 3.8.2.
The two installed CellProfiler modules that require mahotas (or mahotas.features) fail to import it, with identical failed import strings:
Any ideas? Thanks!