Search code examples
pythonpyscript

Pin specific library versions in pyscript py-env


How to specify the library version in pyscript's py-venv tag?

The docs are pretty clear on how to import libraries:

<py-env>
    - bokeh
    - numpy
    - paths:
      - /utils.py
</py-env>

But how do you pin particular library versions? Adding stuff like numpy==1.21.6 seems to break it.


Solution

  • Looking at some examples in the github repository of pyscript(see e.g. here) it should be done as follows:

    <py-env>
     - bokeh
     - numpy
     - panel==0.13.1a2 # here is a specific version of a package
    </py-env>