0

After I installed the conda, I still cannot call the conda. And I follow the below steps to add the path.

sudo gedit ~/.bashrc
export PATH= "/home/howard/anaconda3/bin:$PATH"
sudo gedit /etc/profile
export PATH="/home/howard/anaconda3/bin:$PATH"

source /etc/profile

However, the situation even worst. I cannot call conda and nvcc. "not found" Also, when I restart the terminal, it say

bash: 
export: /home/username/anaconda3/bin:/usr/local/cuda/bin:/usr/local/cuda-10.0/bin:/usr/local/cuda-11.1/bin:/usr/local/cuda-11.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/cuda/bin':
 not a valid identifier

When I wanna get back to ~/.bashrc to delete the export path, by using sudo gedit ~/.bashrc It tells bash: sudo: No such file or directory

Can anyone help?

Tejas Lotlikar
  • 2,945
  • 5
  • 17
  • 26
  • sudo is going to have a different definition of ~ compared to your ordinary user. try issuing the command with the full path the .bashrc file, e.g. sudo gedit /home/myusername/.bashrc but of course you'll need to change that path to match your actual path. – Robert Crovella Dec 02 '20 at 02:30
  • sudo gedit /home/user1/.bashrc bash: home: No such file or directory user1@user1-PC:~$ ls bash: ls: No such file or directory –  Dec 02 '20 at 02:32
  • I don't know the file structure on your machine. /home may not be correct either. As ordinary user, do: cd ~ then do pwd. Then paste that output into your question. – Robert Crovella Dec 02 '20 at 02:35
  • After cd ~ then do pwd /home/user1 However, when I use ls to check the content, bash: ls: No such file or directory –  Dec 02 '20 at 02:36
  • Yes, as your ordinary user, type cd ~ then hit the enter key. After hitting the enter key, type pwd, then hit the enter key again. After hitting the enter key the second time, observe what is printed out at that point in your console, and copy and paste that here. – Robert Crovella Dec 02 '20 at 02:38
  • OK if your home directory is /home/user1 then do ls -a. Is there a file called .bashrc listed? – Robert Crovella Dec 02 '20 at 02:39
  • I copy the pwd return " /home/user1 " in the sudo gedit /home/user1/.bashrc. And the output is bash: sudo: No such file or directory –  Dec 02 '20 at 02:40
  • After I do ls -a, it return bash: ls: No such file or directory I am doubt about whether it is related to "" bash: export: `/home/username/anaconda3/bin:/usr/local/cuda/bin:/usr/local/cuda-10.0/bin:/usr/local/cuda-11.1/bin:/usr/local/cuda-11.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/cuda/bin': not a valid identifier"" –  Dec 02 '20 at 02:41
  • I notice that I keep staying in user1@user1-PC:~$ "~". Is that the reason Is return not founded. –  Dec 02 '20 at 02:49
  • I'm not able to diagnose this. If bash is saying it cannot find "ls" that is pretty bad. – Robert Crovella Dec 02 '20 at 02:57
  • 2
    You need to remove the space after the = in export PATH= "/home/howard/anaconda3/bin:$PATH". Because you messed up PATH you will need to call programs with their full paths like /bin/ls or /usr/bin/sudo gedit ~/.bashrc. In future DON'T use sudo to edit files in ~ (but you will probably need to do so now because they have likely become owned by root) – steeldriver Dec 02 '20 at 03:40
  • 3

0 Answers0