Skip to content

Instantly share code, notes, and snippets.

@jessehub
Last active August 23, 2019 16:17
Show Gist options
  • Save jessehub/b0d582a913262974d9a36e4013e3c5f3 to your computer and use it in GitHub Desktop.
Save jessehub/b0d582a913262974d9a36e4013e3c5f3 to your computer and use it in GitHub Desktop.
Create exec-wrapper for the active conda python environment
#!/bin/sh
# Environment name (ENVNAME) wrapper creator, allowing for execution within that python virtual environ
# invoking as eg: ~/ENVNAME/run-in <command> [<args>]
# Requires https://github.com/gqmelo/exec-wrappers
PYTHONPATH=`which python`
BINDIR=`dirname $PYTHONPATH`
ENVDIR=`dirname $BINDIR`
ENVNAME=`basename $ENVDIR`
create-wrappers -t conda --bin-dir $BINDIR --dest-dir ~/$ENVNAME --conda-env-dir $ENVDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment