Skip to content

Commit

Permalink
Added workaround for conda venv not being recognized as venv by pip
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarina Meyer committed Feb 15, 2024
1 parent 650737d commit 90006b7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions 00_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ echo "#!/bin/bash" >> env.sh
echo "eval \"\$($mamba_bin shell hook --shell=bash)\"" >> env.sh
echo "micromamba activate $venv_dir" >> env.sh
echo "export LD_LIBRARY_PATH=$venv_dir/lib/:$LD_LIBRARY_PATH" >> env.sh
echo "export PIP_REQUIRE_VIRTUALENV=false" >> env.sh
source ./env.sh


Expand All @@ -73,13 +74,13 @@ echo "export CUDAROOT=$CUDAROOT" >> env.sh
source ./env.sh


cuda_version_witout_dot=$(echo $CUDA_VERSION | xargs | sed 's/\.//')
cuda_version_without_dot=$(echo $CUDA_VERSION | xargs | sed 's/\.//')
mark=.done-pytorch
if [ ! -f $mark ]; then
echo " == Installing pytorch $TORCH_VERSION for cuda $CUDA_VERSION =="
version="==$TORCH_VERSION+cu$cuda_version_witout_dot"
echo -e "\npip3 install torch$version torchvision torchaudio --force-reinstall --index-url https://download.pytorch.org/whl/${nightly}cu$cuda_version_witout_dot\n"
pip3 install torch$version torchvision torchaudio --force-reinstall --index-url https://download.pytorch.org/whl/${nightly}cu$cuda_version_witout_dot \
version="==$TORCH_VERSION+cu$cuda_version_without_dot"
echo -e "\npip3 install torch$version torchvision torchaudio --force-reinstall --index-url https://download.pytorch.org/whl/${nightly}cu$cuda_version_without_dot\n"
pip3 install torch$version torchvision torchaudio --force-reinstall --index-url https://download.pytorch.org/whl/${nightly}cu$cuda_version_without_dot \
|| { echo "Failed to find pytorch $TORCH_VERSION for cuda '$CUDA_VERSION', use specify other torch/cuda version (with variables in install.sh script)" ; exit 1; }
python3 -c "import torch; print('Torch version:', torch.__version__)" || exit 1
touch $mark
Expand Down

0 comments on commit 90006b7

Please sign in to comment.