Skip to main content

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.

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.

Install packages using the Shell

Open the Shell tool in the Project Editor and run the appropriate command for your language’s package manager:
npm install <package-name>
You can also use Replit’s Universal Package Manager (UPM) to install packages across supported languages:
upm add <package-name>
To install a specific version:
upm add 'flask==2.3.3'
For all supported languages and package managers, see UPM: Supported Languages.

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”
Agent installs the package using the appropriate package manager for your project and updates the relevant configuration files.

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 add import 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:
upm add 'flask==2.3.3'
You can also exclude specific packages or paths from automatic detection in your .replit file:

Python package managers

When you create a Python Replit App, your package manager is poetry by default. This means pip 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 using pip, follow these steps:
1
Open the Shell and run:Remove the lock file so that the packaging infrastructure switches to pip:
rm poetry.lock
2

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.
3

Clean up pyproject.toml

Delete the [tool.poetry...] sections from pyproject.toml.
After these changes, the packaging infrastructure uses 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 editing replit.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:
SettingDescriptionDefault
packager.languageLanguage used for package operationsDetected automatically
packager.features.guessImportsAutomatically detect and install missing packages on Runtrue
packager.features.packageSearchEnable package search supporttrue
packager.features.enabledForHostingRequire package installation when hostingfalse
packager.afterInstallCommand to run after a package is installed
packager.ignoredPathsPaths to ignore during import detection[]
packager.ignoredPackagesPackages to exclude from automatic detection[]