Open aarontovars opened 7 months ago
Shinylive is currently using Pyodide 0.22.1, not the latest, which is 0.25.0. Note that Pyodide 0.22.1 includes typing-extensions 4.4.0. It may be possible to bring in a newer version of typing-extensions by putting a pypi URL in the requirements.txt, but I don't know for sure.
We are planning on updating to a newer version of Pyodide in the next few weeks, so if you are able to wait, then you shouldn't have to do anything else to make it work.
I see that on our Shinylive page, we haven't mentioned the Pyodide version, but we do link to the latest Pyodide docs, so that discrepancy could be confusing. We can update the docs to make the Pyodide version more clear.
Thanks @wch for your answer!
I have tried putting the pypi URL in the requirements.txt but it doen't even try to install it, probably cause it recognizes that typing-extensions is already installed.
I may be able to wait a few weeks, but I would like to know if there is any possible workaround I can try for the moment.
If you are using the Python shinylive package to do the export (as opposed to just using the app from shinylive.io), you could try doing this:
Make sure you have the latest version of shinylive, with pip install shinylive --upgrade
Find the latest copy of the shinylive assets on disk. It should be 0.2.5:
❯ shinylive assets info
Local cached shinylive asset dir:
/Users/winston/Library/Caches/shinylive
Installed versions:
/Users/winston/Library/Caches/shinylive/shinylive-0.2.5
/Users/winston/Library/Caches/shinylive/shinylive-0.2.4
(If you don't have it, run shinylive assets download
to get it)
Go into that directory, and then into shinylive/pyodide
cd /Users/winston/Library/Caches/shinylive/shinylive-0.2.5
cd shinylive/pyodide
In that directory, remove the existing typing-extensions wheel
rm typing_extensions-4.4.0-py3-none-any.whl
Download a newer version of typing-extensions from PyPI and copy it into that directory.
Also in that directory, edit repodata.json. The JSON will be all on one line, but you can run it through a JSON formatter and it will still work. There will be a section like this:
"typing-extensions": {
"name": "typing-extensions",
"version": "4.4.0",
"file_name": "typing_extensions-4.4.0-py3-none-any.whl",
"install_dir": "site",
"sha256": "329123efe0fb5f6408cfeba434f4fc830d365332c8a9470d11a0284f9835a7f0",
"imports": ["typing_extensions"],
"depends": []
},
You should update the fields version
, file_name
, and sha256
for the new file. For the sha256, you can get it from the PyPI download page. When you're done, save the file.
After you do all that, try doing a shinylive export
and see how it goes.
I did everything you mentioned, but after executing shinylive export and checking the result, still getting this error. Maybe I should reload the dependencies or doing some execution without cache?
Can you check the repodata.json that's in the newly-created export and check if it has the correct version of typing-extensions?
It is now solved, I needed to modify as well the repodata.orig.json.
However, when I export the app and try to open the website, it is shaded, with the only error from terminal:
python3 -m http.server --directory _site --bind localhost 8008 Serving HTTP on ::1 port 8008 (http://[::1]:8008/) ... ::1 - - [01/Feb/2024 09:33:49] "GET / HTTP/1.1" 200 - ::1 - - [01/Feb/2024 09:33:49] "GET /app.json HTTP/1.1" 200 - ::1 - - [01/Feb/2024 09:33:51] "GET /shinylive-sw.js HTTP/1.1" 304 - ::1 - - [01/Feb/2024 09:33:51] "GET /shinylive/pyodide/certifi-2022.12.7-py3-none-any.whl HTTP/1.1" 200 - ::1 - - [01/Feb/2024 09:33:52] code 404, message File not found ::1 - - [01/Feb/2024 09:33:52] "GET /shinylive/libsecret-1.so.0 HTTP/1.1" 404 - ::1 - - [01/Feb/2024 09:33:54] "GET /shinylive-sw.js HTTP/1.1" 304 -
Any hint on how to debug this error?
I'm not sure, but it's possible that adding ceritifi
to your requirements.txt
will fix it.
I have added the following requirements: certifi
, requests
and cryptography
, but the same error message appears when I run the _site
webpage, with a shaded app and no reactivity:
python3 -m http.server --directory _site --bind localhost 8008 Serving HTTP on ::1 port 8008 (http://[::1]:8008/) ... ::1 - - [02/Feb/2024 11:34:48] "GET / HTTP/1.1" 200 - ::1 - - [02/Feb/2024 11:34:48] "GET /app.json HTTP/1.1" 200 - ::1 - - [02/Feb/2024 11:34:50] "GET /shinylive-sw.js HTTP/1.1" 304 - ::1 - - [02/Feb/2024 11:34:51] code 404, message File not found ::1 - - [02/Feb/2024 11:34:51] "GET /shinylive/libsecret-1.so.0 HTTP/1.1" 404 - ::1 - - [02/Feb/2024 11:34:53] "GET /shinylive-sw.js HTTP/1.1" 304 -
If you look in your browser's JS console, it might provide some more useful information.
Description
I'm encountering a version conflict with the
typing-extensions
package in my Shiny for Python app, which I'm trying to export using Shinylive. The core of the issue lies in the dependencies of two critical packages:azure-identity
azure-storage-blob
Both of these packages necessitate
typing-extensions
version >= 4.6.0. However, I'm facing discrepancies in the version requirements as stated in different documentation:typing-extensions == 4.4.0
typing-extensions == 4.9.0
Despite explicitly setting
typing-extensions == 4.9.0
in myrequirements.txt
, a version check inapp.py
reveals that the version being used is still 4.4.0.Concern
I might be overlooking something in the configuration or the build process. Any insights or suggestions to resolve this version mismatch would be greatly appreciated. Is there a specific configuration step I might be missing, or could there be an issue with how Shinylive handles dependencies?