Skip to content

Instantly share code, notes, and snippets.

@lakshanthad
Last active February 17, 2024 09:05
Show Gist options
  • Save lakshanthad/4bfd2bf10148e0b36fa366f2af9f56ce to your computer and use it in GitHub Desktop.
Save lakshanthad/4bfd2bf10148e0b36fa366f2af9f56ce to your computer and use it in GitHub Desktop.
#!/bin/bash
# Get the Python version
python_version=$(python3 -c 'import sys; print("{:.2f}".format(float(".".join(map(str, sys.version_info[:2])))))')
echo -e '\n# set environment variable for Torch' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib/python'$python_version'/site-packages/torch.libs:$HOME/.local/lib/python'$python_version'/site-packages/torch/lib' >> ~/.bashrc
sleep 2
source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment