Home > Software design >  How do you reset bash path variables?
How do you reset bash path variables?

Time:09-12

I have been trying to set $CUDA_PATH so that a package that I'm using is able to see it. I was receiving this error:

RuntimeError: CUDA_PATH environment variable not set - 

When I do

echo $CUDA_PATH

I get an empty return. Apparently, CUDA_PATH is set to be ~/ , which is not right.

I tried to export PATH=$CUDA_PATH:"path_to_cuda". I immediately realised the mistake I made, and I was able to fix the PATH variable so that I can use basic commands like sudo, cd,ls etc. However

Now I am able to use bash commands everywhere except in locations like /etc. I can use cd but I can't use ls, vim, sudo, etc.

How shall I fix this properly? Also, since we are here, how do I set CUDA_PATH properly without messing with the other path variables?

CodePudding user response:

You need to set CUDA_PATH separately, then add it to PATH:

export CUDA_PATH=/path/to/cuda
export PATH=$PATH:$CUDA_PATH

If you need to reset PATH in your current shell, you can either exit the shell and start another one, or re-source your .bashrc or .bash_profile:

. ~/.bashrc
  • Related