Run script outside the sandbox

Hi,
I want to make a script that has the ability to import libraries, like urllib.
Rightt now, I’m getting this error:

2019-09-09 18:01:17 ERROR (SyncWorker_9) [homeassistant.components.python_script.hello_word.py] Error executing script: __import__ not found

I understood it’s because my script runs inside a sandbox.

What can I do?
I need my script to import this library.

Thank you.

Depending on your needs you could always just write the script and then use a command line sensor https://www.home-assistant.io/components/sensor.command_line/ or maybe even just a https://www.home-assistant.io/components/rest/

Or if you would like to dive deeper into HA you could write a custom component. I started with a rest sensor but quickly moved to a custom component since I could then share it with everyone easily :slight_smile:

What you’re attempting to do is the intent of the AppDaemon integration in HA: https://www.home-assistant.io/docs/ecosystem/appdaemon/