holoviz / datashader

Quickly and accurately render even the largest data.
http://datashader.org
BSD 3-Clause "New" or "Revised" License
3.24k stars 363 forks source link

Failed to import `datashader` #1277

Closed jmakov closed 9 months ago

jmakov commented 10 months ago
import datashader

Stack traceback and/or browser JavaScript console output

Traceback (most recent call last): File "", line 1, in File "/home/johan/mambaforge-pypy3/envs/test/lib/python3.9/site-packages/datashader/init.py", line 8, in from .core import Canvas # noqa (API import) File "/home/johan/mambaforge-pypy3/envs/test/lib/python3.9/site-packages/datashader/core.py", line 13, in from .utils import Dispatcher, ngjit, calc_res, calc_bbox, orient_array, \ File "/home/johan/mambaforge-pypy3/envs/test/lib/python3.9/site-packages/datashader/utils.py", line 8, in import numba as nb File "/home/johan/mambaforge-pypy3/envs/test/lib/python3.9/site-packages/numba/init.py", line 43, in from numba.np.ufunc import (vectorize, guvectorize, threading_layer, File "/home/johan/mambaforge-pypy3/envs/test/lib/python3.9/site-packages/numba/np/ufunc/init.py", line 3, in from numba.np.ufunc.decorators import Vectorize, GUVectorize, vectorize, guvectorize File "/home/johan/mambaforge-pypy3/envs/test/lib/python3.9/site-packages/numba/np/ufunc/decorators.py", line 3, in from numba.np.ufunc import _internal SystemError: initialization of _internal failed without raising an exception

Screenshots or screencasts of the bug in action

env.yaml:

name: test
channels:
  - conda-forge
  - defaults
dependencies:
  - bokeh
  - datashader
  - holoviews
  - hvplot
  - ipywidgets
  - jupyter-resource-usage
  - jupyterlab
  - jupyterlab_execute_time
  - jupyterlab_widgets
  - jupyterlab-variableinspector
  - nodejs
  - numpy
  - pandas[performance,parquet,feather]
  - pip
  - polars
  - pyarrow
  - pyyaml
  - python >=3.9
  - python-dateutil
  - ray-default
  - setuptools
  - tqdm
hoxbro commented 9 months ago

Is it possible to give the entire environment with conda env export or pip list?

It seems to be a numba related problem, as the error comes from a simple import import numba as nb. Maybe related to a simple mismatch of dependencies (likely numpy).

jmakov commented 9 months ago
name: quantlab
channels:
  - defaults
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=conda_forge
  - _openmp_mutex=4.5=2_gnu
  - aiohttp=3.8.5=py39hd1e30aa_0
  - aiohttp-cors=0.7.0=py_0
  - aiosignal=1.3.1=pyhd8ed1ab_0
  - anyio=4.0.0=pyhd8ed1ab_0
  - argon2-cffi=23.1.0=pyhd8ed1ab_0
  - argon2-cffi-bindings=21.2.0=py39hb9d737c_3
  - arrow=1.2.3=pyhd8ed1ab_0
  - asttokens=2.4.0=pyhd8ed1ab_0
  - async-lru=2.0.4=pyhd8ed1ab_0
  - async-timeout=4.0.3=pyhd8ed1ab_0
  - attrs=23.1.0=pyh71513ae_1
  - aws-c-auth=0.7.3=he2921ad_3
  - aws-c-cal=0.6.2=hc309b26_0
  - aws-c-common=0.9.0=hd590300_0
  - aws-c-compression=0.2.17=h4d4d85c_2
  - aws-c-event-stream=0.3.2=h2e3709c_0
  - aws-c-http=0.7.12=hc865f51_1
  - aws-c-io=0.13.32=h1a03231_3
  - aws-c-mqtt=0.9.5=h3a0376c_1
  - aws-c-s3=0.3.17=h1678ad6_0
  - aws-c-sdkutils=0.1.12=h4d4d85c_1
  - aws-checksums=0.1.17=h4d4d85c_1
  - aws-crt-cpp=0.23.1=hffbee3f_1
  - aws-sdk-cpp=1.11.156=h8bde0db_1
  - babel=2.12.1=pyhd8ed1ab_1
  - backcall=0.2.0=pyh9f0ad1d_0
  - backports=1.0=pyhd8ed1ab_3
  - backports.functools_lru_cache=1.6.5=pyhd8ed1ab_0
  - beautifulsoup4=4.12.2=pyha770c72_0
  - bleach=6.0.0=pyhd8ed1ab_0
  - blessed=1.19.1=pyhe4f9e05_2
  - bokeh=3.2.2=pyhd8ed1ab_0
  - brotli=1.1.0=hd590300_0
  - brotli-bin=1.1.0=hd590300_0
  - brotli-python=1.1.0=py39h3d6467e_0
  - bzip2=1.0.8=h7f98852_4
  - c-ares=1.19.1=hd590300_0
  - ca-certificates=2023.7.22=hbcca054_0
  - cached-property=1.5.2=hd8ed1ab_1
  - cached_property=1.5.2=pyha770c72_1
  - cachetools=5.3.1=pyhd8ed1ab_0
  - certifi=2023.7.22=pyhd8ed1ab_0
  - cffi=1.15.1=py39he91dace_3
  - charset-normalizer=3.2.0=pyhd8ed1ab_0
  - click=8.1.7=unix_pyh707e725_0
  - cloudpickle=2.2.1=pyhd8ed1ab_0
  - colorama=0.4.6=pyhd8ed1ab_0
  - colorcet=3.0.1=pyhd8ed1ab_0
  - colorful=0.5.4=pyhd8ed1ab_0
  - comm=0.1.4=pyhd8ed1ab_0
  - contourpy=1.1.0=py39h7633fee_0
  - cryptography=41.0.3=py39hd4f0224_0
  - cycler=0.11.0=pyhd8ed1ab_0
  - dask-core=2023.9.1=pyhd8ed1ab_0
  - datashader=0.15.2=pyhd8ed1ab_0
  - datashape=0.5.4=py_1
  - debugpy=1.7.0=py39h3d6467e_0
  - decorator=5.1.1=pyhd8ed1ab_0
  - defusedxml=0.7.1=pyhd8ed1ab_0
  - distlib=0.3.7=pyhd8ed1ab_0
  - entrypoints=0.4=pyhd8ed1ab_0
  - exceptiongroup=1.1.3=pyhd8ed1ab_0
  - executing=1.2.0=pyhd8ed1ab_0
  - filelock=3.12.3=pyhd8ed1ab_0
  - fonttools=4.42.1=py39hd1e30aa_0
  - fqdn=1.5.1=pyhd8ed1ab_0
  - freetype=2.12.1=hca18f0e_1
  - frozenlist=1.4.0=py39hd1e30aa_0
  - fsspec=2023.9.0=pyh1a96a4e_0
  - gflags=2.2.2=he1b5a44_1004
  - glog=0.6.0=h6f12383_0
  - google-api-core=2.11.1=pyhd8ed1ab_0
  - google-auth=2.17.3=pyh1a96a4e_0
  - googleapis-common-protos=1.60.0=pyhd8ed1ab_0
  - gpustat=1.1.1=pyhd8ed1ab_0
  - grpcio=1.46.3=py39h7fbbf82_0
  - holoviews=1.17.1=pyhd8ed1ab_0
  - hvplot=0.8.4=pyhd8ed1ab_1
  - icu=73.2=h59595ed_0
  - idna=3.4=pyhd8ed1ab_0
  - importlib-metadata=6.8.0=pyha770c72_0
  - importlib-resources=6.0.1=pyhd8ed1ab_0
  - importlib_metadata=6.8.0=hd8ed1ab_0
  - importlib_resources=6.0.1=pyhd8ed1ab_0
  - ipykernel=6.25.2=pyh2140261_0
  - ipython=8.15.0=pyh0d859eb_0
  - ipywidgets=8.1.0=pyhd8ed1ab_0
  - isoduration=20.11.0=pyhd8ed1ab_0
  - jedi=0.19.0=pyhd8ed1ab_0
  - jinja2=3.1.2=pyhd8ed1ab_1
  - json5=0.9.14=pyhd8ed1ab_0
  - jsonpointer=2.0=py_0
  - jsonschema=4.19.0=pyhd8ed1ab_1
  - jsonschema-specifications=2023.7.1=pyhd8ed1ab_0
  - jsonschema-with-format-nongpl=4.19.0=pyhd8ed1ab_1
  - jupyter-lsp=2.2.0=pyhd8ed1ab_0
  - jupyter-resource-usage=1.0.1=pyhd8ed1ab_0
  - jupyter_client=8.3.1=pyhd8ed1ab_0
  - jupyter_core=5.3.1=py39hf3d152e_0
  - jupyter_events=0.7.0=pyhd8ed1ab_2
  - jupyter_server=2.7.3=pyhd8ed1ab_0
  - jupyter_server_terminals=0.4.4=pyhd8ed1ab_1
  - jupyterlab=4.0.5=pyhd8ed1ab_0
  - jupyterlab-variableinspector=3.0.9=pyhd8ed1ab_0
  - jupyterlab_execute_time=3.0.1=pyhd8ed1ab_0
  - jupyterlab_pygments=0.2.2=pyhd8ed1ab_0
  - jupyterlab_server=2.25.0=pyhd8ed1ab_0
  - jupyterlab_widgets=3.0.8=pyhd8ed1ab_0
  - keyutils=1.6.1=h166bdaf_0
  - kiwisolver=1.4.5=py39h7633fee_0
  - krb5=1.21.2=h659d440_0
  - lcms2=2.15=haa2dc70_1
  - ld_impl_linux-64=2.40=h41732ed_0
  - lerc=4.0.0=h27087fc_0
  - libabseil=20230802.0=cxx17_h59595ed_3
  - libarrow=13.0.0=h1935d02_4_cpu
  - libblas=3.9.0=18_linux64_openblas
  - libbrotlicommon=1.1.0=hd590300_0
  - libbrotlidec=1.1.0=hd590300_0
  - libbrotlienc=1.1.0=hd590300_0
  - libcblas=3.9.0=18_linux64_openblas
  - libcrc32c=1.1.2=h9c3ff4c_0
  - libcurl=8.2.1=hca28451_0
  - libdeflate=1.18=h0b41bf4_0
  - libedit=3.1.20191231=he28a2e2_2
  - libev=4.33=h516909a_1
  - libevent=2.1.12=hf998b51_1
  - libffi=3.4.2=h7f98852_5
  - libgcc-ng=13.2.0=h807b86a_0
  - libgfortran-ng=13.2.0=h69a702a_0
  - libgfortran5=13.2.0=ha4646dd_0
  - libgomp=13.2.0=h807b86a_0
  - libgoogle-cloud=2.12.0=h8d7e28b_2
  - libgrpc=1.57.0=ha4d0f93_1
  - libjpeg-turbo=2.1.5.1=h0b41bf4_0
  - liblapack=3.9.0=18_linux64_openblas
  - libllvm10=10.0.1=he513fc3_3
  - libnghttp2=1.52.0=h61bc06f_0
  - libnsl=2.0.0=h7f98852_0
  - libnuma=2.0.16=h0b41bf4_1
  - libopenblas=0.3.24=pthreads_h413a1c8_0
  - libpng=1.6.39=h753d276_0
  - libprotobuf=4.23.4=hf27288f_6
  - libsodium=1.0.18=h36c2ea0_1
  - libsqlite=3.43.0=h2797004_0
  - libssh2=1.11.0=h0841786_0
  - libstdcxx-ng=13.2.0=h7e041cc_0
  - libthrift=0.19.0=h8fd135c_0
  - libtiff=4.5.1=h8b53f26_1
  - libunwind=1.6.2=h9c3ff4c_0
  - libutf8proc=2.8.0=h166bdaf_0
  - libuuid=2.38.1=h0b41bf4_0
  - libuv=1.46.0=hd590300_0
  - libwebp-base=1.3.1=hd590300_0
  - libxcb=1.15=h0b41bf4_0
  - libzlib=1.2.13=hd590300_5
  - linkify-it-py=2.0.0=pyhd8ed1ab_0
  - llvmlite=0.36.0=py39h1bbdace_0
  - locket=1.0.0=pyhd8ed1ab_0
  - lz4-c=1.9.4=hcb278e6_0
  - markdown=3.4.4=pyhd8ed1ab_0
  - markdown-it-py=3.0.0=pyhd8ed1ab_0
  - markupsafe=2.1.3=py39hd1e30aa_0
  - matplotlib-base=3.7.2=py39h0126182_0
  - matplotlib-inline=0.1.6=pyhd8ed1ab_0
  - mdit-py-plugins=0.4.0=pyhd8ed1ab_0
  - mdurl=0.1.0=pyhd8ed1ab_0
  - mistune=3.0.1=pyhd8ed1ab_0
  - msgpack-python=1.0.5=py39h4b4f3f3_0
  - multidict=6.0.4=py39h72bdee0_0
  - multipledispatch=0.6.0=py_0
  - munkres=1.1.4=pyh9f0ad1d_0
  - nbclient=0.8.0=pyhd8ed1ab_0
  - nbconvert-core=7.8.0=pyhd8ed1ab_0
  - nbformat=5.9.2=pyhd8ed1ab_0
  - ncurses=6.4=hcb278e6_0
  - nest-asyncio=1.5.6=pyhd8ed1ab_0
  - nodejs=20.6.1=hb753e55_0
  - notebook-shim=0.2.3=pyhd8ed1ab_0
  - numba=0.53.1=py39ha9443f7_0
  - numpy=1.25.2=py39h6183b62_0
  - nvidia-ml-py=12.535.108=pyhd8ed1ab_0
  - opencensus=0.11.2=pyhd8ed1ab_0
  - opencensus-context=0.1.3=py39hf3d152e_1
  - openjpeg=2.5.0=hfec8fc6_2
  - openssl=3.1.2=hd590300_0
  - orc=1.9.0=h52d3b3c_2
  - overrides=7.4.0=pyhd8ed1ab_0
  - packaging=23.1=pyhd8ed1ab_0
  - pandas=2.1.0=py39hddac248_0
  - pandocfilters=1.5.0=pyhd8ed1ab_0
  - panel=1.2.2=pyhd8ed1ab_0
  - param=1.13.0=pyh1a96a4e_0
  - parso=0.8.3=pyhd8ed1ab_0
  - partd=1.4.0=pyhd8ed1ab_0
  - pexpect=4.8.0=pyh1a96a4e_2
  - pickleshare=0.7.5=py_1003
  - pillow=10.0.0=py39haaeba84_0
  - pip=23.2.1=pyhd8ed1ab_0
  - pkgutil-resolve-name=1.3.10=pyhd8ed1ab_0
  - platformdirs=3.10.0=pyhd8ed1ab_0
  - polars=0.19.2=py39h903e532_0
  - pooch=1.7.0=pyha770c72_3
  - prometheus_client=0.17.1=pyhd8ed1ab_0
  - prompt-toolkit=3.0.39=pyha770c72_0
  - prompt_toolkit=3.0.39=hd8ed1ab_0
  - protobuf=4.23.4=py39h60f6b12_2
  - psutil=5.9.5=py39h72bdee0_0
  - pthread-stubs=0.4=h36c2ea0_1001
  - ptyprocess=0.7.0=pyhd3deb0d_0
  - pure_eval=0.2.2=pyhd8ed1ab_0
  - py-spy=0.3.14=h87a5ac0_0
  - pyarrow=13.0.0=py39h6925388_4_cpu
  - pyasn1=0.4.8=py_0
  - pyasn1-modules=0.2.7=py_0
  - pycparser=2.21=pyhd8ed1ab_0
  - pyct=0.4.6=py_0
  - pyct-core=0.4.6=py_0
  - pydantic=1.10.12=py39hd1e30aa_1
  - pygments=2.16.1=pyhd8ed1ab_0
  - pyopenssl=23.2.0=pyhd8ed1ab_1
  - pyparsing=3.0.9=pyhd8ed1ab_0
  - pysocks=1.7.1=pyha2e5f31_6
  - python=3.9.18=h0755675_0_cpython
  - python-dateutil=2.8.2=pyhd8ed1ab_0
  - python-fastjsonschema=2.18.0=pyhd8ed1ab_0
  - python-json-logger=2.0.7=pyhd8ed1ab_0
  - python-tzdata=2023.3=pyhd8ed1ab_0
  - python_abi=3.9=3_cp39
  - pytz=2023.3.post1=pyhd8ed1ab_0
  - pyu2f=0.1.5=pyhd8ed1ab_0
  - pyviz_comms=3.0.0=pyhd8ed1ab_0
  - pyyaml=6.0.1=py39hd1e30aa_0
  - pyzmq=25.1.1=py39hb257651_0
  - ray-core=2.6.3=py39hf5bac6d_1
  - ray-dashboard=2.6.3=py39h7a4ae58_1
  - ray-default=2.6.3=py39hf3d152e_1
  - rdma-core=28.9=h59595ed_1
  - re2=2023.03.02=h8c504da_0
  - readline=8.2=h8228510_1
  - referencing=0.30.2=pyhd8ed1ab_0
  - requests=2.31.0=pyhd8ed1ab_0
  - rfc3339-validator=0.1.4=pyhd8ed1ab_0
  - rfc3986-validator=0.1.1=pyh9f0ad1d_0
  - rpds-py=0.10.2=py39h9fdd4d6_0
  - rsa=4.9=pyhd8ed1ab_0
  - s2n=1.3.51=h06160fa_0
  - scipy=1.11.2=py39h6183b62_0
  - send2trash=1.8.2=pyh41d4057_0
  - setproctitle=1.2.2=py39hb9d737c_2
  - setuptools=68.2.2=pyhd8ed1ab_0
  - six=1.16.0=pyh6c4a22f_0
  - smart_open=6.4.0=pyhd8ed1ab_0
  - snappy=1.1.10=h9fff704_0
  - sniffio=1.3.0=pyhd8ed1ab_0
  - soupsieve=2.5=pyhd8ed1ab_1
  - stack_data=0.6.2=pyhd8ed1ab_0
  - tbb=2020.3=hfd86e86_0
  - terminado=0.17.1=pyh41d4057_0
  - tinycss2=1.2.1=pyhd8ed1ab_0
  - tk=8.6.12=h27826a3_0
  - tomli=2.0.1=pyhd8ed1ab_0
  - toolz=0.12.0=pyhd8ed1ab_0
  - tornado=6.3.3=py39hd1e30aa_0
  - tqdm=4.66.1=pyhd8ed1ab_0
  - traitlets=5.9.0=pyhd8ed1ab_0
  - typing-extensions=4.7.1=hd8ed1ab_0
  - typing_extensions=4.7.1=pyha770c72_0
  - typing_utils=0.1.0=pyhd8ed1ab_0
  - tzdata=2023c=h71feb2d_0
  - uc-micro-py=1.0.1=pyhd8ed1ab_0
  - ucx=1.14.1=h64cca9d_4
  - unicodedata2=15.0.0=py39hb9d737c_0
  - uri-template=1.3.0=pyhd8ed1ab_0
  - urllib3=2.0.4=pyhd8ed1ab_0
  - virtualenv=20.21.0=pyhd8ed1ab_0
  - wcwidth=0.2.6=pyhd8ed1ab_0
  - webcolors=1.13=pyhd8ed1ab_0
  - webencodings=0.5.1=py_1
  - websocket-client=1.6.3=pyhd8ed1ab_0
  - wheel=0.41.2=pyhd8ed1ab_0
  - widgetsnbextension=4.0.8=pyhd8ed1ab_0
  - xarray=2023.7.0=pyhd8ed1ab_0
  - xorg-libxau=1.0.11=hd590300_0
  - xorg-libxdmcp=1.1.3=h7f98852_0
  - xyzservices=2023.7.0=pyhd8ed1ab_0
  - xz=5.2.6=h166bdaf_0
  - yaml=0.2.5=h7f98852_2
  - yarl=1.9.2=py39hd1e30aa_0
  - zeromq=4.3.4=h9c3ff4c_1
  - zipp=3.16.2=pyhd8ed1ab_0
  - zlib=1.2.13=hd590300_5
  - zstd=1.5.5=hfc55251_0
hoxbro commented 9 months ago

It is using an old version of numba, which doesn't seem to have the correct numpy pin.

Try this: conda install numba=0.58 -c numba/label/dev

jmakov commented 9 months ago

install numba=0.58 -c numba/label/dev

Yes, that works. Is there a way I can still use env.yaml or do I need to pin numba?

hoxbro commented 9 months ago

I would add a lower pin to numba like this numba >=0.54 , then it should find the correct version of numpy.

jmakov commented 9 months ago

Thanks for the quick feedback!. Is this something that needs to be in the docs under "installing datashader"?