Hi everyone,
Weâre pleased to announce that itâs now even easier to take advantage of Pythonâs rich packaging ecosystem in Anvil! Today, weâre launching self-service package installation to public beta, bringing the full flexibility of pip install
to your apps and allowing you to install packages yourself.
To access this beta, all you need to do is go to an appâs Settings in the Beta Editor, and select âPython 3.10 (Beta)â from the drop-down in âPython versionsâ.
Once youâve selected Python 3.10 as the Python version for your app, youâll be offered the choice of 3 Base Environments: Minimal, Standard and Data Science. These environments come with different sets of packages pre-installed; for example, Standard includes numpy
and pandas
, and Data Science includes matplotlib
and more. For more information on whatâs in each of the Environments, check out the documentation.
Once youâve chosen a Base Environment, you can add additional packages to your app by entering a given packageâs name (and optionally a version number) as it appears in PyPI:
Then, after youâve added all your desired packages, Anvil will build your appâs new environment; you can see the output of this build process in the collapsible section below Packages.
Anvil will also use safety to check whether the package versions youâve chosen have any known vulnerabilities.
Once youâve set up your appâs environment, youâre good to go! Simply import
your packages in your server code wherever you need.
For more information, including the contents of the Base Environments and guidance for installing packages from sources other than PyPI, check out the documentation:
http://anvil.works/docs/server/custom-packages
This feature is in beta right now - there will probably be some issues, and behaviour may change over the next couple of weeks. As always, please let us know if you have any problems!