Package management in Juno

Although Juno ships with a few important libraries pre-installed, such as SciPy, Scikit-learn, Pandas and others, you can also install additional pure Python packages yourself. To make this process a bit easier, Juno comes with a package manager, which lets you install packages from PyPI (Python Package Index) and manage installed packages.

Overview

You can access package manager from the app settings, or from the editor while editing a notebook: tap notebook name in the top bar and select Package Manager in the popup menu.

Package manager interface consists of two major components: packages list and package details. When opened on an iPad in fullscreen, packages list is displayed on the left, and details of the selected package are displayed on the right.

Juno's package manager

Packages list

Packages list displays all installed packages, letting you filter by package name and/or installation type — that is, whether the package is pinned or user installed.

The packages that come pre-installed at a specific version are called pinned packages. Package manager will not let you delete or upgrade those, as Juno itself may rely on a particular version of a pinned package.

You can use segmented control at the top of the list to filter and display all packages (All), only pinned packages (Pinned), or only packages installed by the user (User). The search field at the top will filter results even further by matching the search query to the packages’ names.

Filters in packages list

This search field also lets you search for and install new packages. Type the package name in the search bar (the name you would otherwise use with the pip command) and tap Search for package distributions for Juno to fetch and display package details from PyPI. You can then select package version and tap Install to install it — although keep in mind that only pure Python packages can be installed due to platform restrictions. Package dependencies will not be installed automatically either, although Juno’s package manager will display the list of dependencies, so that you know what exactly is missing.

Searching for packages

You can delete user installed packages from the list, too: left swipe on a user package will reveal a Delete option.

Package details

Package details screen itself consists of several sub-components: package status message, release selector, list of requirements and project info.

Status message

Package status message

Package status is displayed at the top of package details: for example, it will tell you if the package is pinned at a particular version, or, if it is user installed, which version is installed at the moment. User installed packages will also have a Delete button in the status message area.

Release selector

Package release selector

If the package is not pinned, package manager will display a release selector under the status message area. It lets you select a particular package version and attempt to install it. Attempt is the key word here, as not every package can be installed in Juno due to platform restrictions in the iOS. Furthermore, it is rather hard (if not impossible) to tell if a package can be installed without actually trying to install it. That said, Juno’s package manager tries to infer each version’s compatibility with the iOS by analysing package metadata, and displays a compatibility message next to the release version.

  • Checkmark Compatible means that the package is pure Python, doesn’t rely on native extensions and most likely will be installed successfully.
  • Exclamation mark May work means that metadata does not explicitly state that the package is pure Python, although Juno may be able to install it using source distribution. However, there is a fair chance that installation process requires features that are not available on iOS, and the installation will fail.
  • X mark Not supported means that this package version certainly relies on something that is not allowed on iOS — Install button will be disabled for these releases.

Requirements

Package requirements

For packages with dependencies, package manager will also display a list of package requirements, i.e. other packages it depends on. Juno analyses available package metadata, checks package dependencies against the app’s current environment and displays a requirement fulfillment message for each dependency. This message will warn you if a particular dependency is missing, or if an incompatible version is installed. Selecting a package in the list of requirements will take you to the dependency package details screen, where you can try installing a different version, for example.

Juno’s package manager does not install package dependencies automatically (yet) — although this is something we are working on. For now, you will need to install dependencies manually one by one.

Project info

Package project info

Package manager will display general project info for every package, based on the package metadata. Project info includes project links, type of license, package name and description, as well as project authors and maintainers.

In case of installed packages you can also view license text and top-level modules — these are package names that you will use in your notebook or script in the import statements. For example, to import a class or a function from the Scikit-learn package you will refer to it using its top-level module sklearn.

How to install a package

To install a new package, follow these steps:

  1. Type package name in the search field at the top of the packages list;
  2. If package is not in the list already, tap Search for package distributions;
  3. Make sure the correct package version is selected in Package Releases, or select the version you would like to install;
  4. Tap Install button — package manager will display download and installation progress.

Please, mind that not all packages are compatible, and some may fail to install due to iOS platform restrictions.

Alternatively, you can manually put package sources into the /site-packages directory in Juno’s on-device storage. You should be able to import the package in your notebooks, although if the sources came without metadata (i.e. .egg-info or .dist-info folders or files), it will not be displayed in the list of packages in the package manager.

How to delete a package

There are three ways to delete a package:

  • In packages list: left swipe on a user package will reveal a Delete option.
  • In package details: user installed packages will have a Delete package button in the status message area.
  • By manually deleting package files: delete package sources and package metadata in the /site-packages directory in Juno’s on-device storage.