Skip to content
Kenton Varda edited this page Jan 11, 2015 · 6 revisions

Using Python in Sandstorm apps

This page is a stub. Eventually it will contain a tutorial on how to use Python in a Sandstorm app. (Want to contribute? Edit this page!)

Gotchas

Due to a bug in Python, an exception will be thrown at startup if Python can't determine the current uid's home directory. In general, the concept of a "home directory" does not make sense in Sandstorm.

This can be worked around by defining the HOME environment variable in sandstorm-pkgdef.capnp. Look for the environ field and add HOME to it like so:

environ = [
    # Note that this defines the *entire* environment seen by your app.
    (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"),
    (key = "HOME", value = "/var")
  ]
Clone this wiki locally