Skip to content

Pytables version incompatibility #3162

Closed

Description

@joshs08

Is there an existing issue for this?

  • I have searched the existing issues

Operating System

Description: Ubuntu 24.04.3 LTS
Release: 24.04
Codename: noble

DeepLabCut version

3.0.0rc13

What engine are you using?

pytorch

DeepLabCut mode

single animal

Device type

GeForce RTX 4070

Bug description 🐛

Pytables 3.8.0 was installed as described in the installation documents. Attempting to save a layer of labelled points during frame labeling gives the error:

ImportError: Pandas requires version '3.10.1' or newer of 'tables' (version '3.8.0' currently installed).

This dependency conflict cannot be resolved. Upgrading pytables then leads to another error at the same point:

NotImplementedError: Saving a MultiIndex with an extension dtype is not supported.

Steps To Reproduce

I installed deeplabcut as described:

conda create -n DEEPLABCUT python=3.12
conda activate DEEPLABCUT
conda install -c conda-forge pytables==3.8.0
conda install pytorch cudatoolkit=11.3 -c pytorch
pip install --pre deeplabcut[gui]

python -c "import torch; print(torch.cuda.is_available())"
Returns True.

I created a project, extracted frames from a subset of videos using automatic k-means, with frame cropping from config. I then tried to label frames. When I try to save my layer, I get the error.

Relevant log output

With pytables 3.8.0

python -m deeplabcut
Loading DLC 3.0.0rc13...
Starting GUI...
QPixmap::scaled: Pixmap is a null pixmap
_pythonToCppCopy: Cannot copy-convert 0x653e45e97880 (NoneType) to C++.
_pythonToCppCopy: Cannot copy-convert 0x653e45e97880 (NoneType) to C++.
Traceback (most recent call last):
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari_deeplabcut/_widgets.py", line 656, in <lambda>
    lambda: _save_layers_dialog(
            ^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari_deeplabcut/_widgets.py", line 300, in _save_layers_dialog
    self.viewer.layers.save("", selected=True, plugin="napari-deeplabcut")
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari/utils/_proxies.py", line 188, in __call__
    return self.create(self.__wrapped__(*args, **kwargs))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari/components/layerlist.py", line 476, in save
    return save_layers(path, layers, plugin=plugin, _writer=_writer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari/plugins/io.py", line 229, in save_layers
    _written, writer_name = _write_single_layer_with_plugins(
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari/plugins/io.py", line 442, in _write_single_layer_with_plugins
    written_paths, writer_name = _npe2.write_layers(
                                 ^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari/plugins/_npe2.py", line 111, in write_layers
    paths, writer = io_utils.write_get_writer(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/npe2/io_utils.py", line 115, in write_get_writer
    return _write(path, layer_data, plugin_name=plugin_name, return_writer=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/npe2/io_utils.py", line 318, in _write
    res = writer.exec(args=args)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/npe2/manifest/utils.py", line 61, in exec
    return self.get_callable(reg)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari_deeplabcut/_writer.py", line 79, in write_hdf
    df.to_hdf(path, key="keypoints", mode="w")
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/core/generic.py", line 2789, in to_hdf
    pytables.to_hdf(
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/io/pytables.py", line 313, in to_hdf
    with HDFStore(
         ^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/io/pytables.py", line 578, in __init__
    tables = import_optional_dependency("tables")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/compat/_optional.py", line 187, in import_optional_dependency
    raise ImportError(msg)
ImportError: Pandas requires version '3.10.1' or newer of 'tables' (version '3.8.0' currently installed).



With pytables upgraded to 3.10.2:

python -m deeplabcut
Loading DLC 3.0.0rc13...
Starting GUI...
QPixmap::scaled: Pixmap is a null pixmap
_pythonToCppCopy: Cannot copy-convert 0x5c0b2ac9b880 (NoneType) to C++.
_pythonToCppCopy: Cannot copy-convert 0x5c0b2ac9b880 (NoneType) to C++.
Traceback (most recent call last):
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari_deeplabcut/_widgets.py", line 656, in <lambda>
    lambda: _save_layers_dialog(
            ^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari_deeplabcut/_widgets.py", line 300, in _save_layers_dialog
    self.viewer.layers.save("", selected=True, plugin="napari-deeplabcut")
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari/utils/_proxies.py", line 188, in __call__
    return self.create(self.__wrapped__(*args, **kwargs))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari/components/layerlist.py", line 476, in save
    return save_layers(path, layers, plugin=plugin, _writer=_writer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari/plugins/io.py", line 229, in save_layers
    _written, writer_name = _write_single_layer_with_plugins(
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari/plugins/io.py", line 442, in _write_single_layer_with_plugins
    written_paths, writer_name = _npe2.write_layers(
                                 ^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari/plugins/_npe2.py", line 111, in write_layers
    paths, writer = io_utils.write_get_writer(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/npe2/io_utils.py", line 115, in write_get_writer
    return _write(path, layer_data, plugin_name=plugin_name, return_writer=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/npe2/io_utils.py", line 318, in _write
    res = writer.exec(args=args)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/npe2/manifest/utils.py", line 61, in exec
    return self.get_callable(reg)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/napari_deeplabcut/_writer.py", line 79, in write_hdf
    df.to_hdf(path, key="keypoints", mode="w")
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/core/generic.py", line 2789, in to_hdf
    pytables.to_hdf(
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/io/pytables.py", line 316, in to_hdf
    f(store)
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/io/pytables.py", line 296, in <lambda>
    f = lambda store: store.put(
                      ^^^^^^^^^^
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/io/pytables.py", line 1218, in put
    self._write_to_group(
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/io/pytables.py", line 1957, in _write_to_group
    s.write(
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/io/pytables.py", line 3483, in write
    self.write_index(f"axis{i}", ax)
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/io/pytables.py", line 3123, in write_index
    self.write_multi_index(key, index)
  File "/home/josh/miniforge3/envs/deeplabcut/lib/python3.12/site-packages/pandas/io/pytables.py", line 3151, in write_multi_index
    raise NotImplementedError(
NotImplementedError: Saving a MultiIndex with an extension dtype is not supported.

Anything else?

I tried:
pip install --upgrade tables
which upgrades to 3.10.2

When I then try to save my labeled points I get the error:
NotImplementedError: Saving a MultiIndex with an extension dtype is not supported.
(shown in full above).

Code of Conduct

Activity

  1. deruyter92 commented on Dec 19, 2025

    @deruyter92
    Collaborator

    Thanks for raising this issue. To help us improve our dependency list, would you mind sharing the output of pip list?

    To solve your problem, can you try downgrading your Pandas version? Or if that does not work, maybe start from a clean environment and try the following installation procedure:

    1. Create a conda environment (you can replace the name 'myenv' with your preferred name)
    conda create -n myenv python=3.12
    conda activate myenv
    
    1. Install Pytorch
    conda install pytorch cudatoolkit=11.3 -c pytorch
    

    or if you already have a more recent CUDA version installed on your system (you can check with nvidia-smi):

    pip install torch
    
    1. Install pandas (with pytables and numexpr)
    pip install 'pandas[hdf5,performance]=<2.0.3'
    
    1. Install deeplabcut with GUI
    pip install --pre deeplabcut[gui]
    

    Ideally step 3 could be omitted if our dependency list works for your system. (We might have to update this).

    Hope this helps!

  2. gianmarco-terrones commented on Jan 4, 2026

    @gianmarco-terrones

    I ran into this same issue, and found that fixing pandas to version 2.3 (instead of 3.0.0rc1) allows for labeled frames in napari to be saved.

    conda create -n DEEPLABCUT python=3.12
    conda activate DEEPLABCUT
    conda install -c conda-forge pytables==3.8.0 pandas==2.3
    nvidia-smi # Determining what version of cuda to use in the URL on the next line 
    pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130
    pip install --pre deeplabcut[gui]
    python -c "import torch; print(torch.cuda.is_available())" # returns True
    

    @joshs08, I also tried updating pytables at first, but when I updated it to version 3.10.2 with conda update pytables, in my case the GUI would not even launch:

    (DEEPLABCUT) gianmarco@roadrunner:/MCAM_data/gianmarco/animal_tracking_workspace/20260102_dlc_trialing$ python -m deeplabcut
    Loading DLC 3.0.0rc13...
    Intel oneMKL FATAL ERROR: Cannot load /home/gianmarco/miniforge3/envs/DEEPLABCUT/lib/python3.12/site-packages/torch/lib/libtorch_cpu.so.
    
  3. gianmarco-terrones commented on Jan 4, 2026

    @gianmarco-terrones

    In case it is useful, I am attaching the output of pip list for me.

    piplist_output.txt

  4. added
    dependencies
    on Jan 9, 2026
  5. joshs08 commented on Jan 13, 2026

    @joshs08
    Author

    Thank you so much for the helpful replies! And apologies for the delayed response. I have installed using downgraded pandas as described above (pandas==2.3), and this has fixed the issue. My pip list output for the original erroring environment, and for the enviroment with the issue fixed are attached. Thank you again.

    piplist_error.txt
    piplist_fixed.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

dependencies

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions