Last active
April 22, 2023 14:06
-
-
Save joeld1/c48fda0c312e1ae0715b73877d50f131 to your computer and use it in GitHub Desktop.
Create Conda Virtual Envs for your Poetry Projects (Ideal for Mac M1 users)
This file contains hidden or 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
#!/bin/bash | |
ENV_NAME=$1 | |
PYTHON_VERSION=$2 | |
CONDA_BASE=$(conda info --base)/"etc/profile.d/conda.sh" | |
CONDA_ENV_PATH=$(conda info --base)/"envs/$ENV_NAME" | |
echo "$CONDA_BASE" | |
echo "$CONDA_ENV_PATH" | |
echo yes | conda create -n "$ENV_NAME" python="$PYTHON_VERSION"; | |
conda activate "$ENV_NAME" | |
echo yes | python -m pip install --upgrade pip setuptools wheel; | |
echo yes | conda install notebook ipykernel; | |
ipython kernel install --user --name $ENV_NAME --display-name $ENV_NAME | |
poetry config virtualenvs.path "$CONDA_ENV_PATH" --local | |
poetry config virtualenvs.create 0 --local | |
poetry config virtualenvs.in-project 0 --local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how do I run poetry with this script?