Skip to content

Windows Compatibility Issues with Example Scripts and Setup #65

@aaryan182

Description

@aaryan182

Describe the bug
Running Preswald on Windows encounters multiple issues:

  1. FileNotFoundError when running example scripts (e.g., examples/earthquakes/hello.py)
  2. Path resolution issues with __file__ variable in Windows environment
  3. Data file path resolution failing on Windows-style paths

Steps to Reproduce

  1. Install Preswald on Windows:

    git clone https://github.com/StructuredLabs/preswald.git
    cd preswald
  2. Try to run the earthquake example:

    preswald run examples/earthquakes/hello.py
  3. Observe errors:

    Running 'hello.py' on http://localhost:8501 with log level INFO  🎉!
    Starting Preswald server at http://localhost:8501
    Will run script: /preswald/examples/earthquakes/hello.py
    INFO:     Started server process [487]
    INFO:     Waiting for application startup.
    INFO:     Application startup complete.
    INFO:     Uvicorn running on http://0.0.0.0:8501
    FileNotFoundError: [Errno 2] No such file or directory: 'data/earthquake_data.csv'
    

Expected behavior

  • Example scripts should run without path-related errors on Windows
  • File paths should be properly resolved regardless of OS
  • Data files should be found using relative paths from the script location

Environment

  • OS: Windows 11
  • Python version: 3.x
  • Shell: Git Bash/PowerShell/CMD

Additional context
The issues appear to be related to:

  • Windows path separator differences (\ vs /)
  • Path resolution in Windows environment
  • Relative path handling in different shells on Windows

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