2

I have wirtten some lines in python and want to integrate them into my website. As soon as I want to use them I recieve an error-message stating that the module can't be found:

JsException(PythonError: Traceback (most recent call last): File "/lib/python3.10/site-packages/_pyodide/_base.py", line 429, 
in eval_code .run(globals, locals) File "/lib/python3.10/site-packages/_pyodide/_base.py", 
line 300, in run coroutine = eval(self.code, globals, locals) File "", line 1, 
in ModuleNotFoundError: No module named 'theblockchainapi' )

The html is very basic:

<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
    <script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<title>Document</title>

</head>
<body>
    <div>
        <input type="text" id = "address"> <br>
       <button id="button">Verify NFT</button>
        <div id="out">none</div>
    </div>
</body>
</html>
<py-env>
- theblockchainapi 
</py-env>
<py-script> 
from theblockchainapi import SolanaAPIResource, SolanaNetwork
</py-script>
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
24Doggi
  • 59
  • 3

1 Answers1

4

The package theblockchainapi requires the SSL module. The SSL modules, along with requests are not supported in web browsers. This is a security limitation for all browser applications and not just PyScript.

The solution will require modifying theblocckchainapi package to use supported browser APIs.

John Hanley
  • 74,467
  • 6
  • 95
  • 159