Virtual Environments and requirements.txt Best Practices | NodeFlux.eu Docs

Manage Python package dependencies efficiently using virtualenv, pip freeze, and pinned versions.

Steps

  1. Create a requirements.txt file listing all dependencies needed by your project.
  2. Pin specific package versions to avoid unexpected breaking changes: requests==2.31.0.
  3. Do not upload local virtualenv folder (.venv or venv) over SFTP.
  4. Let NodeFlux automatic runtime installer build the virtual environment inside the container.
  5. If adding new packages later, update requirements.txt and restart the service to trigger pip install sync.

Notes