(Pyscript) website showing No module named 'mysql'

I’m uploading the following .html to WinSCP, but facing ModuleNotFoundError: No module named 'mysql'

  • html script
      <link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
      <script defer src="https://pyscript.net/latest/pyscript.js"></script>

    <b><p>title <u><label id="AAA"></label></u> </p></b>

        import mysql.connector

        mydb = mysql.connector.connect(
        mycursor = mydb.cursor()
        mycursor.execute("SELECT row_01 FROM database")                       
        myresult = mycursor.fetchall()
        list_01 = []
        for row in myresult:
          temp_val = row[0]
  • error message
Traceback (most recent call last):
  File "/lib/python3.10/site-packages/_pyodide/_base.py", line 435, in eval_code
    .run(globals, locals)
  File "/lib/python3.10/site-packages/_pyodide/_base.py", line 304, in run
    coroutine = eval(self.code, globals, locals)
  File "<exec>", line 1, in <module>
ModuleNotFoundError: No module named 'mysql'
  • pic: the ModuleNotFoundError on online website
    the ModuleNotFoundError on online website

I already do pip install mysql on my pc, but online website still get this error, so where show I pip install or what shall I do

To include a package in the environment, add a <py-config> tag with a packages value. For example:

  packages = ['mysql-connector-python']

See the <py-config> reference for details. Pyodide (the primary runtime used by PyScript) uses that list of packages to install from either its own list of included packages or from pure Python wheels on PyPi.