Replit provides several ways to install and manage packages for your Replit App. You can install packages using the Shell, ask Agent to handle it for you, or let Replit automatically detect and install missing dependencies when you run your Replit App.Documentation Index
Fetch the complete documentation index at: https://docs.replit.com/llms.txt
Use this file to discover all available pages before exploring further.
Install packages using the Shell
Open the Shell tool in the Project Editor and run the appropriate command for your language’s package manager:Install packages using Agent
You can ask Agent to install packages for you directly in chat. For example:- “Install the axios package”
- “Add Flask and SQLAlchemy to my project”
- “Set up TailwindCSS”
Automatic import detection
Replit automatically analyzes your code for missing dependencies each time you select Run. If your code imports a package that is not yet installed, Replit detects it and installs the latest version automatically. For example, if you addimport flask to main.py, the next time you select Run, the Console displays a message indicating that Flask is being installed.
You can configure automatic import detection in the .replit file using the
packager.features.guessImports setting.Override automatic detection
If the wrong package was detected, or you need a specific version, run the correct install command in the Shell. For example:Python package managers
When you create a Python Replit App, your package manager is poetry by default. This meanspip install does not manage your dependencies. Instead, use poetry add <package> or upm add <package> in the Shell.
Switch from poetry to pip
If you prefer usingpip, follow these steps:
Move your dependencies
Transfer your dependencies from the
[tool.poetry.dependencies] section in pyproject.toml to requirements.txt. For example, flask = "^3.0.2" becomes flask>=3.0.2,<4.pip for all future operations, and automatic import detection continues to work as expected.
System dependencies with Nix
Replit supports all programming languages through integration with Nix. If you need system-level dependencies beyond standard language packages, you can add them to your replit.nix file.Nix packages
Add system-level dependencies by editingreplit.nix directly. You can search for available packages at search.nixos.org.
Modules
Modules combine support for programming languages, formatters, and packagers. They provide the foundation for your Replit App. If you create a Replit App from a template or GitHub repository, Replit automatically installs the required modules. You can customize modules and other Nix settings using the .replit file.Packager configuration
You can fine-tune package management behavior in your .replit file:| Setting | Description | Default |
|---|---|---|
packager.language | Language used for package operations | Detected automatically |
packager.features.guessImports | Automatically detect and install missing packages on Run | true |
packager.features.packageSearch | Enable package search support | true |
packager.features.enabledForHosting | Require package installation when hosting | false |
packager.afterInstall | Command to run after a package is installed | — |
packager.ignoredPaths | Paths to ignore during import detection | [] |
packager.ignoredPackages | Packages to exclude from automatic detection | [] |