Last active
August 19, 2024 03:54
-
-
Save geriskenderi/0a5abbaf11251b7981a27c38b704bdb3 to your computer and use it in GitHub Desktop.
Export a Python environment that has packages installed with conda and pip
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
# Extract installed pip packages, export conda environment without builds, and then append pip packages | |
pip_packages=$(conda env export | grep -A9999 ".*- pip:" | grep -v "^prefix: ") && conda env export --from-history | grep -v "^prefix: " > environment.yml && echo "$pip_packages" >> environment.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment