All of the sudden, my terminal stopped recognizing the 'conda'. Also the VS Code stopped seeing my environments.
All the folders, with my precious environments are there (/opt/anaconda3
), but when I type conda I get:
conda
zsh: command not found: conda
I tried install conda again (from .pkg
) but it fails at the end of installation (no log provided).
How can I clean it without losing my envs?
I use Apple M1 MacBookPro with Monterey.
CodePudding user response:
To recover conda if it has disappeared and you're getting a "command not found" error, follow these steps:
Check if conda is installed on your system by running the command:
which conda
If the above command doesn't return anything, you may need to add the path to your conda installation to your PATH environment variable. To find the path, run the following command:
find / -name conda 2>/dev/null
Add the path to your .bashrc or .bash_profile file:
export PATH="/bin:$PATH"
Restart your terminal or run the following command to reload your environment variables:
source ~/.bashrc
Try running conda again to see if it's working.
If conda is still not working, it may have been uninstalled or moved. In that case, you can reinstall conda from the Anaconda website or from the Miniconda website.
CodePudding user response:
For some reason my .zshrc
file was corrupted after some operations.
This prevented terminal to call conda init
and in general, to have 'conda' call understandable.
What is more - this prevented installing any condas, minicondas, minoforge. Both from .pkg
and .sh
- annoyingly - without any log, information - just crash and goodbye.
I cleared both .zshrc' and
.bash_profile` and then it helped - I managed to install minigorge and have my 'conda' accessible from terminal.
Unfortunately, in the process I removed all my previous 'envs'.