Replit supports a variety of languages and dependency management systems through the Dependencies tool. This section will cover the different types of dependencies and how to manage them in your Replit App.
Imports
tab. This tab allows you to view and manage the packages grouped by language. Links are also provided to the appropriate packager file, such as package.json
for Node.js.
Add new package
will allow you to search for and install new packages. The language dropdown provides quick access between packagers.
Console
tab.
poetry
or npm
. Any changes to the packager files will be reflected in the Dependencies
tool, but require the respective CLI command or using the Run button to properly update.
import flask
to main.py
, the next time you select Run, you’ll see a section in the Console indicating that the latest version of Flask is being installed:
upm
in the shell to resolve the conflict:
pip install
to manage dependencies manually. Instead of running pip install <package>
, you can instead run poetry add <package>
or upm add <package>
, which will do the same thing.
pip
is one of the earliest, and consequently most popular, package managers for Python. You can use pip
as your Replit App’s package manager instead of poetry
.
Follow the steps below:
requirements.txt
file using the following command:poetry.lock
file.
[tool.poetry.dependencies]
to requirements.txt
. Note that the flask = "^3.0.2"
in pyproject.toml
’s [tool.poetry.dependencies]
section would become flask>=3.0.2,<4
in requirements.txt
.
[tool.poetry...]
sections from pyproject.toml
.
pip
for all future operations.
Now, as you add code to your main.py
file, any time you select Run, upm will determine whether there are any missing packages for your imports, find the latest versions of packages that provide those imports, and install them automatically.