Skip to main content

Run command with environment populated by the .env file.

Project description

Run command with environment variables populated by python-dotenv.


If using Pipenv:

pipenv install --dev python-dotenv-run


pip install python-dotenv-run

Instruction onwards assumes you use Pipenv. If you do not, simply drop the pipenv run prefix in all commands.


Say you have a Flask app in a file named

import flask

app = flask.Flask(__name__)

def hello():
    return "Hello World!"

Add a file named .env alongside with the project:

After installing dependencies, you can run it like this:

pipenv run dotenv-run flask run

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-dotenv-run, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size python_dotenv_run-0.1.4-py2.py3-none-any.whl (4.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size python-dotenv-run-0.1.4.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page