question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[3.1] Convolve problems in some affiliated packages

See original GitHub issue

I just uploaded astropy 3.1 to Debian (which succeeds all its own tests on build time), and found that gammapy now shows some CI test errors:

__________ ERROR collecting astro/darkmatter/tests/test_profiles.py ___________
ImportError while importing test module '/usr/lib/python3/dist-packages/gammapy/astro/darkmatter/tests/test_profiles.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3/dist-packages/astropy/convolution/convolve.py:27: in <module>
    _convolve = load_library("_convolve", LIBRARY_PATH)
/usr/lib/python3/dist-packages/numpy/ctypeslib.py:131: in load_library
    from numpy.distutils.misc_util import get_shared_lib_extension
/usr/lib/python3/dist-packages/numpy/distutils/__init__.py:6: in <module>
    from . import ccompiler
/usr/lib/python3/dist-packages/numpy/distutils/ccompiler.py:11: in <module>
    from distutils import ccompiler
E   ImportError: cannot import name 'ccompiler' from 'distutils' (/usr/lib/python3.7/distutils/__init__.py)

During handling of the above exception, another exception occurred:
/usr/lib/python3/dist-packages/gammapy/astro/darkmatter/__init__.py:4: in <module>
    from .spectra import *
/usr/lib/python3/dist-packages/gammapy/astro/darkmatter/spectra.py:9: in <module>
    from ...spectrum.models import TableModel
/usr/lib/python3/dist-packages/gammapy/spectrum/__init__.py:4: in <module>
    from .observation import *
/usr/lib/python3/dist-packages/gammapy/spectrum/observation.py:12: in <module>
    from ..irf import EffectiveAreaTable, EnergyDispersion, IRFStacker
/usr/lib/python3/dist-packages/gammapy/irf/__init__.py:10: in <module>
    from .psf_gauss import *
/usr/lib/python3/dist-packages/gammapy/irf/psf_gauss.py:9: in <module>
    from astropy.convolution import Gaussian2DKernel
/usr/lib/python3/dist-packages/astropy/convolution/__init__.py:10: in <module>
    from .convolve import convolve, convolve_fft, interpolate_replace_nans, convolve_models  # noqa
/usr/lib/python3/dist-packages/astropy/convolution/convolve.py:29: in <module>
    raise ImportError("Convolution C extension is missing. Try re-building astropy.")
E   ImportError: Convolution C extension is missing. Try re-building astropy.

It seems that #7293 caused this. I already filed gammapy/gammapy#1974, but when looking into the stacktrace again, it looks more a bug in astropy, right? Photutils has the same problem, as seen here; also radio-beam, spectral-cube and others. It may well be that my specific build was done errornously; however I am then wondering why the build time tests succeeded. Build log (including tests) is here. I couldn’t find anything that did not build there. This happens with numpy 1.16rc1 (which is now in Debian unstable); I applied #8264 to my package to make it compatible. Maybe I missed something here?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
olebolecommented, Dec 31, 2018

@saimn the missing distutils package was the cause of the problem, thank you very much for the hint! I don’t know whether this should be added to setup.py, so I leave it open for that case. Pls close otherwise.

0reactions
saimncommented, Jan 2, 2019

distutils is part of the stdlib so there is no point in adding it to setup.py, it is not an external package, and the issue is only because of the way debian package it. Also, thinking again about this, distutils should be a (debian) dependency for numpy instead of astropy, as astropy only use it via numpy.distutils.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved Python Convolution (20%) 3.1 2D convolution Using the
This problem has been solved! You'll get a detailed solution from a subject matter expert that helps you learn core concepts. Using the...
Read more >
Chapter 3: Problem Solutions
Chapter 3: Problem Solutions. Fourier Analysis of Discrete Time Signals. Problems on the DTFT: Definitions and Basic Properties а Problem 3.1. Problem.
Read more >
CS6640: Image Processing Project 2 Filtering, Edge detection ...
2.3.3 Convolution issue. As you can see on the figure 3 (b), to fit perfectly in the image, the center of the kernel...
Read more >
Convolution kernels for multi-wavelength imaging
The point-spread function (PSF), also known as beam, is one of the main characteristics of any astronomical imager. · We first consider an...
Read more >
LAPACK — Linear Algebra PACKage - The Netlib
The associated matrix factorizations (LU, Cholesky, QR, SVD, Schur, ... LAPACK addresses this problem by reorganizing the algorithms to use block matrix ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found