Skip to content

PyKoopman Import Issue: "AttributeError: module 'torch' has no attribute 'uint64'" #63

@snjie209

Description

@snjie209

Seems like I am encountering this error when importing pykoopman in a Google Colab notebook:

!pip install pykoopman==1.0.9 pydmd

then in another cell:

# System Packages
import os
import time

# Data manipulation
import numpy as np
import pandas as pd

# Plotting
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.patches as patches

# Optimization
from scipy.integrate import odeint, solve_ivp
from scipy.optimize import least_squares, curve_fit
from scipy.signal import detrend, savgol_filter

# PyKoopman
import pykoopman as pk
from pydmd import DMD

# Performance metrics
from sklearn.metrics import r2_score

THEANO_FLAGS = "optimizer=fast_compile"

print(f"NumPy Version: {np.__version__}")

Error:

[/usr/local/lib/python3.11/dist-packages/safetensors/torch.py](https://2xd2w1cmhh5-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20250808-060057_RC01_792725924#) in <module>
    437     _SIZE.update(
    438         {
--> 439             torch.uint64: 8,
    440             torch.uint32: 4,
    441             torch.uint16: 2,

[/usr/local/lib/python3.11/dist-packages/torch/__init__.py](https://2xd2w1cmhh5-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20250808-060057_RC01_792725924#) in __getattr__(name)
   1831         return importlib.import_module(f".{name}", __name__)
   1832 
-> 1833     raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
   1834 
   1835 from . import _logging

AttributeError: module 'torch' has no attribute 'uint64'

it must be because Torch just released version 2.8.0 on August 6th 2025 and some other folks are having this issue in packages using torch.

I am curious if folks have any ideas on how to debug the issue?

Thanks!
Samba

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions