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 installprocess securely in the background. - Environment Audit: The panel automatically parses the deep
.dist-infofolders 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 (100MB for Free, 1GB for Pro). 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:
- Pre-Flight Check: Before launching the installer, the platform calculates your current disk usage.
- Installation:
pipdownloads and compiles the requested package. - 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 uninstallto roll back the change. - You receive a clean
507 Insufficient Storageerror, and your project remains healthy and functional.
Tiered Networking Architecture
To maintain platform security, the ability to download libraries from the internet is managed based on your tier.
Free Tier: Secure Proxying
Free 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, the installation may be blocked for security reasons.
Pro Tier: Unrestricted Direct Access
Pro users bypass the proxy entirely. Your workstation has direct, high-speed access to the global internet, allowing you to install any package regardless of where its source files or assets are hosted.
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 stored in your project's hidden .pypackages/bin folder.
For Pro Users, this path is automatically injected into the $PATH of your Bash Terminal. This means immediately after installing a package like django, you can open the Terminal tab and run django-admin startproject natively.