When we are running conda command, we may get this error: Bad Interpreter: No such file or directory. In this tutorial, we will introduce you how to fix.
For example, if we have installed Anaconda3 in our linux system.
We have run conda command as follows:
./conda env list
We may get this error:
How to fix this error?
Step 1: view conda file in anaconda3/bin/conda
For example:
cat conda
We may see:
We can find the first line is our error.
Step 2: edit conda file and update the absolute python file in the first line
For example:
vi conda
The modified file is:
Moreover, if you find some error also exist, you may have to modify activate, deactivate file etc al.
Finally, we can run command below to fix this error:
./conda init bash
We may find a .bashrc file in /root/.bashrc and add it to linux environment path
source /root/.bashrc
Then we can find this error is fixed: