AIAgentfy

Fix "No module named caas_jupyter_tools" (and ace_tools)

Exported code from an AI sandbox can import a display helper that does not exist in your local Python environment. Use a small local shim to keep the notebook running.

Independent page. Not affiliated with OpenAI, Google, Anthropic, or any vendor or tool named here. Tool names are discussed as observed public references; no official documentation or endorsement is implied.

Quick fix: the shim

Save the code below as ace_tools.py or caas_jupyter_tools.py, matching the module name in the traceback. Put it beside the script or notebook, then restart the kernel. The download buttons create the file locally in your browser.

"""Local compatibility shim for code that imports caas_jupyter_tools or ace_tools.

This is an independent helper, not an official module from OpenAI, Google,
Anthropic, or any other vendor.
"""

try:
    from IPython.display import display as _display
except ImportError:
    _display = None


def display_dataframe_to_user(name, dataframe):
    """Display a DataFrame-like object in a notebook or terminal."""
    print(f"\n=== {name} ===")
    if _display is not None:
        try:
            _display(dataframe)
            return dataframe
        except Exception:
            pass

    to_string = getattr(dataframe, "to_string", None)
    if callable(to_string):
        print(to_string(max_rows=50))
    else:
        print(dataframe)
    return dataframe


def _unimplemented(attribute):
    def stub(*args, **kwargs):
        print(f"[compatibility shim] {attribute} is not implemented")
        return None

    return stub


def __getattr__(attribute):
    # Keeps older exported notebooks running when they call a helper not
    # reproduced here. Replace an individual stub if you need real behaviour.
    return _unimplemented(attribute)

Save the same file under the module name your traceback requests.

No file version: run this before the import that fails. It installs an in-memory module and prints the DataFrame when IPython display is unavailable.

import sys, types

def display_dataframe_to_user(name, dataframe):
    print(f"\n=== {name} ===")
    print(dataframe)
    return dataframe

m = types.ModuleType("ace_tools")
m.display_dataframe_to_user = display_dataframe_to_user
sys.modules["ace_tools"] = m
sys.modules["caas_jupyter_tools"] = m

Why this error happens

The traceback means Python searched the current directory and the active environment's import path but did not find a module with that name. Public exports from some AI code environments include calls to a hosted display helper. The surrounding pandas code can be portable, but that helper is an environment-specific dependency.

The ModuleNotFoundError is therefore about the display module, not about the contents of the DataFrame. Replacing the helper often lets the analysis continue; replacing it does not guarantee that every other sandbox-only import will work.

The shim module

The shim first tries to use IPython.display.display, which gives the rich table view in Jupyter and Colab. If IPython is unavailable, it calls dataframe.to_string(max_rows=50) for a plain terminal-friendly result. The module-level __getattr__ returns a visible placeholder for other helper names instead of failing at import time.

This is a compatibility replacement written for this guide. It is not the original module and it does not reproduce private sandbox behaviour.

Where to put the file

Plain Python script

Put the file in the same directory as the script and run Python from that directory. Python normally adds the script directory to sys.path.

project/
  analysis.py
  ace_tools.py
  caas_jupyter_tools.py

Jupyter or VS Code notebook

Put the module in the notebook's working directory, then restart the kernel. If the notebook starts elsewhere, print import os; print(os.getcwd()) and place the file in that folder or add the file's folder to sys.path.

Google Colab

Upload the shim to the Colab file browser or write it from a cell, then restart the runtime if the failed import was cached. A module already held in sys.modules from a partial run can be cleared by restarting the kernel.

Why not just pip install it?

A package can use the same name without being the helper expected by the notebook. Installing an unfamiliar package also runs its install logic and adds code to your environment. The identity and contents of similarly named packages were not verified for this guide as of October 2026. Prefer a local shim you can read, or ask the notebook author for the original implementation.

Older name: ace_tools vs. newer name: caas_jupyter_tools

Public examples have used both names for the display-helper import. Exports from different model or product versions may preserve different module names. Use the exact one shown in your traceback. If a notebook uses both, save the same shim under both filenames.

See your DataFrame without code

If you only need to inspect the data, export it with df.to_csv("data.csv", index=False) and open it in the browser CSV and DataFrame viewer. It provides search, sorting and filtered CSV download without uploading the rows.

FAQ

What does "No module named caas_jupyter_tools" mean?

Python could not find a module with that name on the import path. Exported notebook code may expect a hosted sandbox helper that is not installed in your local Jupyter, Colab, IDE or script environment.

How do I fix ModuleNotFoundError: No module named 'ace_tools'?

Create ace_tools.py beside the script, or put a local module named ace_tools earlier on Python's import path. The shim on this page supplies display_dataframe_to_user and a fallback for other helper names.

What is display_dataframe_to_user?

It is a helper name commonly used to display a DataFrame-like object with a heading. It is not part of standard pandas. The function name describes the job; the implementation depends on the environment that provided it.

Can I pip install caas_jupyter_tools or ace_tools?

Do not assume the package is the helper referenced by an exported notebook. Third-party packages with similar names may be unrelated, and their contents can change. This guide recommends a local shim you can inspect. If you install any package, review its source, maintainer and license first.

Why does ChatGPT's code use caas_jupyter_tools or ace_tools?

Publicly discussed exports suggest these names were available as display helpers in some AI code-sandbox environments. Different versions may use different helper modules. The exact implementation is not part of the standard Python library, so local execution can fail.

Does the shim work in Google Colab, VS Code and plain Python scripts?

The module file works with any Python environment where it can be imported. In Jupyter or Colab it uses IPython display when available; in a plain script it prints a text table. Keep the shim beside the notebook or script, or make its folder importable.

Related