Forked from kobybibas/Install requirement file using conda with pip fallback
Created
December 23, 2022 12:13
-
-
Save dermatologist/14e63aa667e49f8563b30ce020fc54cf to your computer and use it in GitHub Desktop.
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
# Having a requirements.txt file has follows | |
torch==1.5.0 | |
numpy==1.18.1 | |
# Add channels. Last added is with the highest priorety | |
conda config --add channels pytorch | |
conda config --add channels conda-forge | |
conda config --add channels anaconda | |
# Install pip for fallback | |
conda install --yes pip | |
# Install with conda. If package installation fails, install with pip. | |
while read requirement; do conda install --yes $requirement || pip install $requirement; done < requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment