pythonpyscriptpyodide

How do I import packages with Pyscript? Following examples leads only to failure


I'm trying to create a page on Pyscript.com. My config looks like this:

    <py-config>
        packages = [
        "pandas",
        "ast",
        "re"]
        
        [[fetch]]
        from = 'https://rstory.mypinata.cloud/ipfs/Qmakqr9oKVNcNtdhjkLBc4AuJv3731KKkrCkndLSPvDwjz'
    </py-config>

Running this raises the following error: "(PY1001): Unable to install package(s) 'pandas, ast, re'. Reason: Can't find a pure Python 3 Wheel for package(s) 'pandas, ast, re'.See: https://pyodide.org/en/stable/usage/faq.html#micropip-can-t-find-a-pure-python-wheel for more information."

I've tried placing my config in head tags and in a separate file as well linking directly to Python wheels, but all I get are errors. I've seen other projects using Pandas with this exact config pattern and they work. What am I doing wrong?

The complete code for my site is here.


Solution

  • ast and re are in the standard library, and so don’t need to be installed via packages. You can think of the packages key as equivalent as the list of things you’d use pip to install - in this case, just pandas.