Skip to main content

Compilation Errors

Type Inference Failures

Shed Skin requires all variables to be implicitly statically typed. Mixed types are the most common cause of compilation failures.

Dynamic Type Errors

If you see errors like “function mixed with non-function” or dynamic variable errors: Problem: Variables changing types during execution
Solution: Use consistent types throughout
For optional values, use None with container types (list, dict, class instances) but not with scalar types (int, float, bool).

Mixed Container Types

Problem: Collections with mixed element types
Solution: Keep collection elements homogeneous
Exception: Tuples of length 2 can have mixed types

Format String Errors

Problem: Non-constant or non-string format strings
Solution: Use constant format strings

Unsupported Python Features

Shed Skin reports errors for unsupported Python features. Common issues:

Unsupported Statements

  • match/case statements (Python 3.10+)
  • try..finally blocks (use try..except instead)
  • Nested functions and classes
  • Multiple inheritance

Unsupported Syntax

  • Argument unpacking (*args, **kwargs)
  • Variable annotation syntax in some contexts
  • eval, getattr, hasattr, isinstance
Use block comments with #{ and #} to exclude code that cannot be compiled but should run in CPython.

Linker Errors

Missing Libraries

Problem: Linker cannot find required libraries (libgc, libpcre2) On Linux:
On macOS:
On Windows: Ensure CMake and Visual Studio Build Tools are properly installed.
Starting with Shed Skin 0.9.12, the --local-deps flag (now default) builds dependencies from bundled sources, eliminating external package manager requirements.

Library Path Issues

Problem: Libraries installed but not found by linker Solution: Use local dependencies
Or set library paths manually:

Platform-Specific Issues

Windows

nmake Not Found

Problem: CMake cannot find nmake command Solution: Use Visual Studio Developer Command Prompt
  1. Open Start Menu
  2. Search for “Developer Command Prompt for VS”
  3. Run Shed Skin commands from this prompt

Path Length Limitations

Problem: Build fails due to Windows path length limits Solution: Build in a directory closer to drive root

macOS

M1/M2 Architecture Issues

Problem: Library conflicts on Apple Silicon Solution: Ensure libraries are built for correct architecture

Linux

Python Development Files Missing

Problem: Cannot build extension modules Solution: Install Python dev package

Runtime Errors

Segmentation Faults

Problem: Program crashes with segfault Common Causes:
  1. None/NULL pointer dereference
    Solution: Check for None before use
  2. Index out of bounds (when using --nobounds)
    The --nobounds flag disables bounds checking for performance. Only use it after thorough testing.
  3. Garbage collection issues If crashes occur with --nogc, the Boehm GC may need reconfiguration.

Incorrect Results

Integer Overflow

Problem: Calculations produce unexpected results Cause: By default, Shed Skin uses 32-bit signed integers Solution: Use 64-bit integers for large values

Floating Point Precision

Problem: Different results from CPython Cause: Fast math optimizations can affect precision Solution: Avoid -ffast-math flag for precision-critical code

Module Import Errors

Cannot Locate Module

Problem: “cannot locate module: modulename” Causes:
  • Module name contains invalid characters (only letters, digits, underscores)
  • Module file not in search path
  • Module uses unsupported features
Solution: Ensure module follows naming conventions

Unsupported Standard Library Module

Problem: Import works in Python but fails in Shed Skin
Only about 30 standard library modules are supported. See Supported Modules for the complete list.
Solution: For extension modules, import unsupported libraries only in non-compiled code:

Build System Issues

CMake Configuration Fails

Problem: CMake cannot configure project Solution: Reset build directory

Parallel Build Failures

Problem: Build fails when using --jobs flag Solution: Try building with fewer jobs or sequentially

Getting Help

Before reporting an issue, try:
  1. Simplifying your code to isolate the problem
  2. Checking if the issue occurs with a minimal example
  3. Searching existing issues
If you’ve tried the solutions above and still have problems:
  1. Check GitHub Issues: github.com/shedskin/shedskin/issues
  2. Report a Bug: Include:
    • Minimal code example that reproduces the issue
    • Shed Skin version (shedskin --version)
    • Operating system and version
    • Full error message and traceback
  3. Community Support: Join discussions on GitHub
Shed Skin is experimental software. Please report bugs to help improve it!