Virtual Environments

The use of virtual environments is recommended when working on shared projects. Virtual environments create an isolated workspace for each project, helping to prevent conflicts between dependencies that may require different versions of the same package.

Python Virtual Environments

We recommend using uv to manage Python virtual environments as it provides an overarching framework for managing Python installations and virtual environments. See information on uv in the uv documentation.

R Virtual Environments

R virtual environments can be created using the renv package. See documentation for more information about how to use renv.

Stata Virtual Environments

While Stata does not have a native, versioned package repository that enables virtual environments identical to those in R and Python, you can still achieve similar functionality for reproducible workflows. The repado command in the repkit package helps manage ado dependencies and supports more consistent, portable Stata environments across machines and over time. See the repado documentation and tutorial developed by the World Bank DIME Analytics unit.

Docker

Docker is a tool that allows you to create, deploy, and run applications using containers. In some instances, it may be more appropriate to use Docker containers to manage your project environment, especially when there is a project environment that needs to be deployed to cloud computing services.

Learning Resources

Back to top