Import non standard python module in Appdaemon

Hi everybody, I’d like to import https://github.com/clach04/python-tuya to use it with Appdaemon on Hassio - Raspberry
I can’t find the way to do this.
Is there any guide / tutorial / help to follow?
I found this Adding additional python libraries AppDaemon but I cannot find any of the following things in Hassio and Appdaemon file system:
“You need to include it in the python_packages portion of the add-on config”

Thanks and ciao

Hi @robbymazzoni,
You should add the package within the appdaemon add-on configuration. This can be found if you click on the sidebar on Hass.io and then go to the appdaemon addon. There are the configuration parameters.

Something like this:

{
  "log_level": "info",
  "system_packages": [
  ],
  "python_packages": [
    "python-tuya"
  ]
}

Then it should be available to import.

Hope this helps.

Ok, thank you very much, now it’s clear. I also need to install a C compiler cause I have none on my Windows PC. Which one do you suggest?

Thanks again and Ciao

Hi @imaikel, maybe you can help me also with the following issue.
I installed all the needed tools to compile the tuyapi addon but I get an error on this .py file

import appdaemon.plugins.hass.hassapi as hass
import pytuya
class Tuyatest(hass.Hass):
 
    def initialize(self):

        d = pytuya.OutletDevice("mycode", "myIP", "myKey")

        self.dati = d.status()
        self.log("data: {}".format(self.dati))

        # wait for something
        self.listen_state(self.testpytuya, "light.luce_studio")

    def testpytuya (self, entity, attribute, old, new, kwargs):
        self.log("slider_name: {}".format(old))

The error is:

d = pytuya.OutletDevice(“mycode”, “myIP”, “myKey”)
AttributeError: module ‘pytuya’ has no attribute ‘OutletDevice’

If I run the same routine in standard Python works perfectly.
What do you think I’m doing wrong?