Troubleshooting Guide

This guide covers common issues you might encounter while using True-Core and their solutions.

Missing Dependencies

ModuleNotFoundError: No module named ‘tomlkit’

Problem: When running Python code, you encounter the following error:

ModuleNotFoundError: No module named 'tomlkit'

Solution: Install the missing dependency:

pip install tomlkit

ModuleNotFoundError: No module named ‘yaml’

Problem: When running Python code, you encounter the following error:

ModuleNotFoundError: No module named 'yaml'

Solution: Install PyYAML:

pip install pyyaml

ModuleNotFoundError: No module named ‘watchdog’

Problem: When working with OSUtils, you may encounter the following error:

ModuleNotFoundError: No module named 'watchdog'

Solution: Install watchdog:

pip install watchdog

Enum Registry Issues

Using enum.auto() Instead of true.enum_registry.auto()

Problem: Using enum.auto() from the standard library causes crashes:

from enum import auto  # Wrong import!

class MyEnum(Enum):
    VALUE = auto()  # This will cause issues

Solution: Always use true.enum_registry.auto():

from true.enum_registry import auto  # Correct import

class MyEnum(Enum):
    VALUE = auto()  # This works correctly

Type System Issues

BigDecimal Validation Errors

Problem: Unexpected validation errors with BigDecimal:

from true.types import BigDecimal

value = BigDecimal("123.456789123456789")  # Validation error

Solution: Ensure proper decimal string format and consider precision limits:

# Correct usage with proper precision
value = BigDecimal("123.456789", precision=6)

File Operations

FileNotFoundError with Directory Operations

Problem: Errors when trying to access directories:

FileNotFoundError: [Errno 2] No such file or directory: 'path/to/dir'

Solution: Ensure directory exists before operations:

from true.collections import Directory

# Create directory if it doesn't exist
dir = Directory("path/to/dir")
dir.create(parents=True)  # Creates parent directories if needed

MoviePy Video Creation Issues

Problem: Video creation fails without fps parameter:

# This might fail
create_static_video("input.jpg", "output.mp4")

Solution: Always specify the fps parameter:

# This works correctly
create_static_video("input.jpg", "output.mp4", fps=24)

Installation Issues

Poetry Installation Failures

Problem: Poetry fails to install dependencies.

Solution: Try these steps:

  1. Update poetry:

    poetry self update
    
  2. Clear poetry cache:

    poetry cache clear . --all
    
  3. Install with specific groups:

    poetry install --with dev,docs
    

Development Environment

Missing Type Hints

Problem: Type checking errors or missing type hints.

Solution: Install type checking dependencies:

poetry install --with dev
# or
pip install mypy types-PyYAML types-tomlkit

Then run type checking:

mypy true

Still Having Issues?

If you’re still experiencing problems:

  1. Check the Changelog for known issues in your version

  2. Ensure all dependencies are properly installed

  3. Update to the latest version of True-Core

  4. Open an issue on our GitHub repository