Install & Compatibility
Where this runs
tested against v1.7.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 7.1s · import 0.000s · 261MB
263MB installed
● package 263MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
taichi
✓ import taichi as ti
ti.math
✓ import taichi as ti
# ... later in code ...
vec = ti.math.vec3(1, 2, 3)
ti.real_func
✓ @ti.real_func
✗ @ti.experimental.real_func
The experimental decorator was deprecated in v1.7.0.
This example initializes Taichi, declares two 2D fields, and then defines a Taichi kernel to perform a simple computation over all elements. The `@ti.kernel` decorator compiles the Python function into a high-performance kernel that runs on the chosen backend (CPU or GPU).
import taichi as ti
ti.init(arch=ti.cpu) # Try ti.gpu for GPU acceleration if available
# Declare a 2D field (similar to a NumPy array)
N = 32
x = ti.field(ti.f32, shape=(N, N))
y = ti.field(ti.f32, shape=(N, N))
@ti.kernel
def compute():
for i, j in x: # Iterate over all elements in the field x
x[i, j] = float(i + j) / N
y[i, j] = x[i, j] * 2.0
if __name__ == '__main__':
compute()
print(f"x[0,0]: {x[0,0]}")
print(f"y[0,0]: {y[0,0]}")
# Fields can be converted to NumPy arrays for further processing:
# x_np = x.to_numpy()
# print(x_np[0,0])
ti --version
Debug
Known issues
breakingThe `@ti.experimental.real_func` decorator was deprecated in Taichi v1.7.0 and replaced by `@ti.real_func`.fixUpdate your code to use `@ti.real_func` instead of `@ti.experimental.real_func`.
affects: >=1.7.0
breakingThe `field_dim` argument for `ti.ndarray` has been removed. Use `ndim` instead.fixReplace `field_dim` with `ndim` when creating `ti.ndarray` instances. For example, `ti.ndarray(ti.f32, ndim=2)`.
affects: >=1.5.0
breakingThe `ti.Matrix.rotation2d()` method was removed. Its functionality is now provided by `ti.math.rotation2d()`.fixMigrate calls from `ti.Matrix.rotation2d()` to `ti.math.rotation2d()`.
affects: >=1.4.0
breakingThe `packed` and `dynamic_index` arguments in `ti.init()` have been removed. `packed` was removed in v1.4.0, `dynamic_index` in v1.5.0.fixRemove these arguments from your `ti.init()` calls. Taichi's SNode system has evolved to handle these aspects more automatically or through different configuration mechanisms.
affects: >=1.4.0 (packed), >=1.5.0 (dynamic_index)
gotchaSlicing a single row or column of a `ti.Matrix` now returns a vector, not a 1xN or Nx1 matrix, potentially leading to dimension mismatches in subsequent matrix operations.fixIf a matrix type is explicitly required, you may need to explicitly construct a 1xN or Nx1 matrix from the resulting vector, e.g., `ti.Matrix.rows([my_vector])` or `ti.Matrix.cols([my_vector])`.
affects: >=1.4.0
deprecatedThe `ti.cc` backend is deprecated in favor of the Taichi Runtime (TiRT) and its C API, especially for Ahead-of-Time (AOT) deployment.fixConsider migrating AOT workflows to use TiRT. Refer to Taichi's AOT documentation for the latest deployment strategies.
affects: >=1.5.0
Errors
Common errors & fixes
AttributeError: module 'taichi' has no attribute 'experimental'
Attempting to use `@ti.experimental.real_func` after Taichi v1.7.0.
fixReplace `@ti.experimental.real_func` with `@ti.real_func`.
TypeError: ndarray() got an unexpected keyword argument 'field_dim'
Using the `field_dim` argument with `ti.ndarray` after Taichi v1.5.0.
fixChange `field_dim` to `ndim` when defining your `ti.ndarray`, e.g., `ti.ndarray(ti.f32, ndim=2)`.
AttributeError: 'Matrix' object has no attribute 'rotation2d'
Calling `rotation2d()` directly on a `ti.Matrix` object after Taichi v1.4.0.
fixUse `ti.math.rotation2d()` for 2D rotation matrix generation.
TypeError: ti.init() got an unexpected keyword argument 'packed'
Using the `packed` argument in `ti.init()` after Taichi v1.4.0.
fixRemove `packed=True/False` from your `ti.init()` call. The SNode system manages memory packing automatically.
Upgrade
Version history
1.7.4latest on PyPI · released Jul 31, 2025
Audit
Dependencies
No dependency data recorded yet.