the same .py script run itself works successfully, but in html get error
environment: open the live server on visual studio code to run .html
<html>
<head>
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
</head>
<body>
<b><p>this is the info from sql</p></b>
<br>
<py-config>
packages = ["mysql"]
</py-config>
<py-script >
import mysql.connector
import webbrowser
import time
import pymysql
mydb = mysql.connector.connect(
host="196.168.101.141",
user="root",
password="password123",
database="cool_db",
auth_plugin='mysql_native_password'
)
mycursor = mydb.cursor()
mycursor.execute("SELECT P_TITLE,P_DESC FROM webpage WHERE P_ID = 'en_1-01'")
myresult = mycursor.fetchall()
print(myresult)
</py-script>
</body>
</html>
- error message
(PY1001): Unable to install package(s) 'mysql'. Reason: Can't find a pure Python 3 Wheel for package(s) 'mysql'. See: https://pyodide.org/en/stable/usage/faq.html#micropip-can-t-find-a-pure-python-wheel for more information.
Question: Can PyScript (Pyodide + WASM + ...)in browser connects to the SQL server?
- If could, how can I correct it?
- If not, how can I do to achive the same goal