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

collageradiomics requires calling import twice #42

Closed
robtoth opened this issue Jun 24, 2020 · 1 comment
Closed

collageradiomics requires calling import twice #42

robtoth opened this issue Jun 24, 2020 · 1 comment
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@robtoth
Copy link
Contributor

robtoth commented Jun 24, 2020

System Info

  • Windows 10 64-bit
  • Python 3.8.2
  • Mahotas 1.4.10

System Info

Error

>>> import collageradiomics
Could not import submodules (exact error was: DLL load failed while importing _bbox: The specified module could not be found.).

There are many reasons for this error the most common one is that you have
either not built the packages or have built (using `python setup.py build`) or
installed them (using `python setup.py install`) and then proceeded to test
mahotas **without changing the current directory**.

Try installing and then changing to another directory before importing mahotas.
>>> import collageradiomics
>>>

Diagnosis

The problem seems to be with the Mahotas import, since calling import mahotas gives the same error (and has the same resolution).

The output of the dir command shows a limited install of Mahotas:

>>> dir(mahotas)
['', 'all', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec_', 'citation', 'citation_text', 'e', 'short_citation_text', 'stderr', 'sys']

The expected output is:

>>> dir(mahotas)
['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_bbox', '_center_of_mass', '_convex', '_convolve', '_distance', '_filters', '_histogram', '_labeled', '_morph', 'as_rgb', 'bbox', 'border', 'borders', 'bwperim', 'cdilate', 'center_of_mass', 'cerode', 'citation', 'citation_text', 'close', 'close_holes', 'colors', 'convolve', 'convolve1d', 'croptobbox', 'cwatershed', 'daubechies', 'demos', 'dilate', 'disk', 'distance', 'dog', 'edge', 'erode', 'euler', 'features', 'find', 'fullhistogram', 'gaussian_filter', 'gaussian_filter1d', 'get_structuring_elem', 'haar', 'histogram', 'hitmiss', 'idaubechies', 'ihaar', 'imread', 'imresize', 'imsave', 'internal', 'io', 'label', 'labeled', 'labeled_sum', 'laplacian_2D', 'locmax', 'locmin', 'mahotas_version', 'majority_filter', 'mean_filter', 'median_filter', 'moments', 'morph', 'open', 'otsu', 'overlay', 'polygon', 'rank_filter', 'rc', 'regmax', 'regmin', 'resize', 'resize_to', 'segmentation', 'short_citation_text', 'sobel', 'stretch', 'stretch_rgb', 'template_match', 'test', 'tests', 'thin', 'thresholding', 'wavelet_center', 'wavelet_decenter']

The output of its version command also is failing:

>>> print(mahotas.mahotas_version._version_)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'mahotas' has no attribute 'mahotas_version'

The expected output is:

>>> print(mahotas.mahotas_version.__version__)
1.4.10

Overall, it seems that only a limited version of Mahotas, without its modules, was installed when pip install collageradiomics was called.

Potential Resolution

calling import again seems to resolve the issue.

>>> import collageradiomics; import collageradiomics
@nathanhillyer nathanhillyer added the bug Something isn't working label Jun 24, 2020
@nathanhillyer nathanhillyer added the wontfix This will not be worked on label Sep 10, 2020
@nathanhillyer
Copy link
Contributor

Will re-open if we receive more reports-- appears fixed for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants