I downloaded PyScript from https://pyscript.net/ and installed it on ubuntu 18 server successfully. But then I found it is NOT standalone, means it depends on pyodide.js at http://cdn.jsdelivr.net. I traced the URL and downloaded the pyodide.js and made changes to pyconfig.ts accordingly, but it was not surprisingly failed to work.
I found the packages.json file refers to a lot of .whl files that may assemble Anaconda. So, it is clear that PyScript needs Anaconda (no doubt, it is quite natural). My question is: how can I set up a PyScript server without direct connection to the Internet? I have to use it behind the firewall, a simple bypass may not help because the heavy trafic to the CDN server.
Thank you for the reply.
I’d read the discussion on github. If there is no misunderstanding, the discussion suggests me to build the pyodide by hand before achieving my “real offline”. And the how-to tutorial has not done yet. Or, has the tutorial already completed?
The simplest method is to load your PyScript program into a web browser. Open the Chrome debugger and go to the Network tab. That will show you everything that was downloaded and the URLs. Download each URL and store it on your web server. You will need to use a web server.
Note: that method will only download the files your program requires beyond the core files.
Modify your PyScript application to tell it where to download PyScript:
Then set up a web server such as Apache. I wrote an article on how to do that. You can also use Nginx or a custom server (Flask, Django, etc) with the correct setup.
There are other methods, such as using a WebWorker, which enables your application to run without the Internet.