Created
March 14, 2020 08:53
-
-
Save bmmalone/10c247b108654c42bb6655a6a931dd71 to your computer and use it in GitHub Desktop.
Automation on top of conda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
function mkipycondaenv { | |
if [ "$#" -ne 1 ]; then | |
echo "usage: mkipycondaenv <condaenv_name>" | |
return 1 | |
fi | |
conda create --name "$1" pip wheel jupyter ipykernel | |
conda activate "$1" | |
python3 -m ipykernel install --user --name "$1" --display-name "$1" | |
ln -s `which pip` `which pip`3 | |
} | |
### | |
# We can use `ipy` to ensure we always use the python instance in the virtual | |
# environment: https://coderwall.com/p/xdox9a/running-ipython-cleanly-inside-a-virtualenv | |
### | |
alias ipy="python -c 'import IPython; IPython.terminal.ipapp.launch_new_instance()'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Presumably, this function is imported in
.bashrc
or similar so that the commands are available from a shell using a statement similar to the following.