How Do You Manage Dependencies in a Python Project Using `pip` and `virtualenv`?

·

`pip` is used to install packages from PyPI. `virtualenv` creates isolated Python environments to manage dependencies.

Example:

# Create a virtual environment
$ python -m venv myenv

# Activate the virtual environment
$ source myenv/bin/activate

# Install a package
$ pip install requests

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *