Open Editor →

Package Management

Extend your Python applications with external libraries. Learn how we handle dependencies securely using isolated, persistent user-space directories.

The Lean Runtime Philosophy

Instead of forcing you to work inside massive, bloated environments with thousands of pre-installed libraries, Python Online follows a Lean Runtime philosophy. We provide a minimal, high-performance Python 3.12 environment and give you the tools to install exactly what you need.

The Benefits for You:

  • Instant Startup: Because our base environment is small, your Linux containers spin up in milliseconds rather than seconds.
  • Total Control: You aren't limited to a "standard library". If a package is available on PyPI (the Python Package Index), you can install it.
  • Predictability: By choosing your own dependencies, you avoid version conflicts common in "kitchen sink" environments.

The .pypackages Standard

When you install a library on Python Online, it is not installed globally into the container's root OS. Instead, we follow a modern Python user-space standard.

Every project has a hidden directory at its root called .pypackages. The backend dynamically injects environment variables (PYTHONUSERBASE and PYTHONPATH) into every execution context. This seamlessly tricks the Python interpreter into loading dependencies directly from this isolated folder.

Absolute Persistence & Isolation:
Because your libraries are stored as physical files inside your project's directory on our cloud storage, they are perfectly isolated. Installing Requests v2.31 in Project A will never interfere with Requests v2.25 in Project B.

Using the Packages Panel

The left sidebar contains the Packages Panel, a fully integrated UI for managing your environment.

  • Real-Time PyPI Search: Search for your favorite package directly from the within the IDE. As you type, the platform queries the Python Package Index (PyPI) and displays live metadata, including the latest version numbers and package descriptions.
  • One-Click Installation: When you click "Install", the platform initiates a worker that will handle the pip install process securely in the background.
  • Environment Audit: The panel automatically parses the deep .dist-info folders within your project to display an accurate, real-time list of every library currently installed in your environment.

Storage Quotas & Atomic Rollback

Because dependencies are physical files on your persistent disk, they count toward your account's storage quota (512MB). Libraries containing heavy C-binaries (like tensorflow or pytorch) can be hundreds of megabytes in size.

To prevent a massive installation from corrupting your project or locking your account due to quota limits, Python Online employs an Atomic Rollback safety net:

  1. Pre-Flight Check: Before launching the installer, the platform calculates your current disk usage.
  2. Installation: pip downloads and compiles the requested package.
  3. Post-Flight Verification: The platform measures your directory size again. If the newly installed package pushed your project over its storage limit, the orchestrator immediately triggers an automated pip uninstall to roll back the change.
  4. You receive a clean 507 Insufficient Storage error, and your project remains healthy and functional.

Secure Networking Architecture

To maintain platform security, users download packages through a Secure Whitelist Proxy. This gateway allows unrestricted access to official, trusted domains like pypi.org and files.pythonhosted.org.

Note that if a specific library requires downloading secondary assets from an unverified third-party domain during installation, the process may be blocked for security reasons.

CLI Tools & Executable Binaries

Many Python packages are not just libraries; they include command-line tools (e.g., flask, pytest, or black). When you install one of these packages, the executable binaries are safely stored in your project's hidden .pypackages/bin folder.