Skip to main content

dumpenv: Dump values of the current Python environment

Project description

https://travis-ci.org/guettli/dumpenv.svg?branch=master

dumpenv: Dump values of the current Python environment

https://github.com/guettli/dumpenv

Why?

Sometimes source code works in one environment, but in a different environment it fails.

Same source code, but different results …. Hmm, there must be a differenence in the environment …. but what?

You can use this tool to dump a lot of values which influence the python interpreter.

Then you can use any diff tool (I like meld) to compare both environments.

At the moment these text files get created:

  • PATH

  • os

  • os_environ

  • pip_freeze

  • platform

  • site

  • sys_path

I guess the above names do not need any explanation.

Above files get created in a temporary directory which roughly looks like this:

/tmp/dumpenv_{USER}@{HOST}--{VIRTUAL_ENV}_RANDOM

Feedback welcome, please create an issue at github.

Usage

Usage:

user1@host1> dumpenv
Dumped environment to OUT1

user2@host2> dumpenv
Dumped environment to OUT2

me@pc> scp user1@host1:/tmp/OUT1/ tmp/
me@pc> scp user2@host2:/tmp/OUT2/ tmp/
me@pc> meld tmp/OUT1 tmp/OUT2

… Ah! Now you see the difference :-)

Install

Install from pypi:

pip install dumpenv

Use Cases

Use case 1: Your script works, but it does not, if called via unix cron. Run dumpenv via shell and via cron and compare the result.

Use case 2: Your code works via web (wsgi, django, …) but it fails if you call it on the shell.

Use case 3: Your code works in the development environment, but not on the production server.

Project details


Download files

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

Source Distribution

dumpenv-2018.1.0.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file dumpenv-2018.1.0.tar.gz.

File metadata

  • Download URL: dumpenv-2018.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15rc1

File hashes

Hashes for dumpenv-2018.1.0.tar.gz
Algorithm Hash digest
SHA256 d104b0235d6d4eb708a581d0dc0b7c843683acb5cbab48ac6af81ef19a5a368a
MD5 d4015c132c3cbc0382e43aa9490ee9dd
BLAKE2b-256 d5f59da54a451f2d4387ead0b28c196ed836c865d4db0b7f70f54520169386f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page