enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.28k stars 282 forks source link

Github Actions core dumped #1166

Closed Davide-sd closed 1 year ago

Davide-sd commented 1 year ago

I'm trying to get Github Actions to run my tests (involving Mayavi). However, the run fails when executing the following line of code:

from mayavi import mlab

Those are the requirements of my package and this is the traceback (here is the full report):

2022-08-12T09:41:12.3034402Z Fatal Python error: Aborted
2022-08-12T09:41:12.3034984Z 
2022-08-12T09:41:12.3036758Z Current thread 0x00007f69288bd740 (most recent call first):
2022-08-12T09:41:12.3044115Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/pyface/ui/qt4/init.py", line 36 in <module>
2022-08-12T09:41:12.3044754Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3045210Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3045730Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3046178Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3046605Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3047029Z   File "<frozen importlib._bootstrap>", line 1030 in _gcd_import
2022-08-12T09:41:12.3047559Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/importlib/__init__.py", line 127 in import_module
2022-08-12T09:41:12.3048140Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/importlib/metadata.py", line 86 in load
2022-08-12T09:41:12.3049020Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/pyface/base_toolkit.py", line 218 in import_toolkit
2022-08-12T09:41:12.3049797Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/pyface/base_toolkit.py", line 263 in find_toolkit
2022-08-12T09:41:12.3050567Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/pyface/toolkit.py", line 23 in <module>
2022-08-12T09:41:12.3051094Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3051548Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3051984Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3052413Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3053079Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3053789Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traitsui/qt4/toolkit.py", line 33 in <module>
2022-08-12T09:41:12.3054317Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3054758Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3055197Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3055649Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3056086Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3056535Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3056968Z   File "<frozen importlib._bootstrap>", line 1058 in _handle_fromlist
2022-08-12T09:41:12.3057675Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traitsui/qt4/__init__.py", line 35 in <module>
2022-08-12T09:41:12.3058198Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3058655Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3059078Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3059525Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3060099Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3060530Z   File "<frozen importlib._bootstrap>", line 1030 in _gcd_import
2022-08-12T09:41:12.3061055Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/importlib/__init__.py", line 127 in import_module
2022-08-12T09:41:12.3061597Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/importlib/metadata.py", line 86 in load
2022-08-12T09:41:12.3062370Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/pyface/base_toolkit.py", line 282 in find_toolkit
2022-08-12T09:41:12.3063135Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traitsui/toolkit.py", line 110 in toolkit
2022-08-12T09:41:12.3063916Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traitsui/toolkit_traits.py", line 43 in ColorTrait
2022-08-12T09:41:12.3064689Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traits/trait_factory.py", line 40 in __call__
2022-08-12T09:41:12.3065479Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traitsui/editors/code_editor.py", line 32 in CodeEditor
2022-08-12T09:41:12.3066356Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traitsui/editors/code_editor.py", line 21 in <module>
2022-08-12T09:41:12.3066891Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3067349Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3067787Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3068219Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3068653Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3069358Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traitsui/editors/api.py", line 96 in <module>
2022-08-12T09:41:12.3070308Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3070752Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3071188Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3071629Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3072060Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3072780Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traitsui/editors/__init__.py", line 16 in <module>
2022-08-12T09:41:12.3073413Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3073868Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3074304Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3074745Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3075171Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3075610Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3076064Z   File "<frozen importlib._bootstrap>", line 972 in _find_and_load_unlocked
2022-08-12T09:41:12.3076497Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3077186Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/traitsui/api.py", line 257 in <module>
2022-08-12T09:41:12.3077701Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3078151Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3078585Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3079024Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3079447Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3080302Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/mayavi/preferences/preference_manager.py", line 29 in <module>
2022-08-12T09:41:12.3080867Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3081318Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3081758Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3082188Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3082616Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3083323Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/mayavi/preferences/api.py", line 4 in <module>
2022-08-12T09:41:12.3083850Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3084306Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3084728Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3085164Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3085600Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3086320Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/mayavi/tools/engine_manager.py", line 13 in <module>
2022-08-12T09:41:12.3086847Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3087298Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3087730Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3088172Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3088605Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3089284Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/mayavi/tools/camera.py", line 24 in <module>
2022-08-12T09:41:12.3089801Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3090250Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3090675Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3091101Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3091606Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3092275Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/mayavi/mlab.py", line 16 in <module>
2022-08-12T09:41:12.3092785Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3093242Z   File "<frozen importlib._bootstrap_external>", line 850 in exec_module
2022-08-12T09:41:12.3093667Z   File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
2022-08-12T09:41:12.3094107Z   File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
2022-08-12T09:41:12.3094546Z   File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
2022-08-12T09:41:12.3094996Z   File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
2022-08-12T09:41:12.3095422Z   File "<frozen importlib._bootstrap>", line 1058 in _handle_fromlist
2022-08-12T09:41:12.3096124Z   File "/home/runner/work/sympy-plot-backends/sympy-plot-backends/tests/test_backends.py", line 54 in <module>
2022-08-12T09:41:12.3096941Z   File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/_pytest/assertion/rewrite.py", line 168 in exec_module
2022-08-12T09:41:12.3097324Z   ...
2022-08-12T09:41:19.9510773Z /home/runner/work/_temp/b0b6cfba-6180-4b7e-ae1b-cf10a438731c.sh: line 1:  2190 Aborted                 (core dumped) coverage run -m pytest

Everything works fine on my local system, so I'm guessing this is happening because Github Actions runs headless. What can I do to make it works?

xiaofeiso commented 1 year ago

do you know how to solve it? I have a same problem.

Davide-sd commented 1 year ago

@xiaofeiso you have to install appropriate dependencies based on the OS you are running tests. I'm going to copy a section of a python-package.yml which used to work with Ubuntu 20.04, but doesn't work with Ubunu 22.04. The commented section is what you need (and probably have to fix).

name: Python package

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.7", "3.8", "3.9", "3.10"]

    steps:
    - uses: actions/checkout@v2
    # - name: Install Linux packages for Qt5 support # needed for Mayavi
    #   run: |
    #     sudo apt-get update
    #     sudo apt-get install qt5-default
    #     sudo apt-get install libxkbcommon-x11-0
    #     sudo apt-get install libxcb-icccm4
    #     sudo apt-get install libxcb-image0
    #     sudo apt-get install libxcb-keysyms1
    #     sudo apt-get install libxcb-randr0
    #     sudo apt-get install libxcb-render-util0
    #     sudo apt-get install libxcb-xinerama0
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        python -m pip install flake8 pytest coverage
        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
xiaofeiso commented 1 year ago

very thanks