-
Notifications
You must be signed in to change notification settings - Fork 58
Importing requests or aiohttp #508
-
I'm writing a service that fetches a URL, code is as simple as it gets. I read https://hacs-pyscript.readthedocs.io/en/latest/reference.html#importing which said how to use requests
properly but recommends aiohttp
. I tried both but I get
Exception in </config/pyscript/.py> line 1: import aiohttp ^ ModuleNotFoundError: import of aiohttp not allowed
and
Exception in </config/pyscript/.py> line 1: import requests ^ ModuleNotFoundError: import of requests not allowed
This is my pyscript section of configuration.yaml
pyscript:
allow_all_imports: true
hass_is_global: true
Anyone got an idea what I'm doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions
Note from the documentation:
Pyscript can be configured using the UI, or via yaml..... You can’t mix these two methods - your initial choice determines how you should update these settings later. If you want to switch configuration methods you will need to uninstall and reinstall pyscript.
Replies: 2 comments 1 reply
-
Have you restarted HASS? Another thing to try is to change those two settings via HACS.
Beta Was this translation helpful? Give feedback.
All reactions
-
Note from the documentation:
Pyscript can be configured using the UI, or via yaml..... You can’t mix these two methods - your initial choice determines how you should update these settings later. If you want to switch configuration methods you will need to uninstall and reinstall pyscript.
Beta Was this translation helpful? Give feedback.
All reactions
-
This was it, I thought I had configuration through yaml set up but turns out it was UI instead. Cheers!
Beta Was this translation helpful? Give feedback.