Conda is not recognized as an internal or external command - anaconda

Command line screen capture
I have successfully installed Anaconda on my drive D and added it to my path so that I am able to access it from cmd without using the Anaconda prompt.
However, after running where conda on the Anaconda prompt, I got the 3 different locations
- D:\Anaconda\Library\bin\conda.bat
- D:\Anaconda\Scripts\conda.exe
- D:\Anaconda\condabin\conda.bat
to set as paths but after doing that, the conda command on my command line still does not work.

From the error image and description of the issue, I can see that you have installed the anaconda in the D:\ drive and tried to access it through the C:\ drive.
To access the conda in command prompt, you need to run the below commands :
C:\Users\Loni Tande>cd D:\Anaconda\Scripts
D:\Anaconda\Scripts>conda
D:\Anaconda\Scripts>conda --version
Please make sure you have the latest Anaconda version installed in your system to access all its functionalities.

Related

"conda: command not found", Bash on Windows

I have installed Bash for windows by activating the Windows Subsystem for Linux and installing Ubuntu and when I installed Anaconda I selected the "Add Anaconda to my PATH environment variable" setting, so I do not believe there are any issues with PATH.
What I see in my Edit environment variables window is:
C:\Users\user\anaconda3
C:\Users\user\anaconda3\Library\mingw-w64\bin
C:\Users\user\anaconda3\Library\usr\bin
C:\Users\user\anaconda3\Library\bin
C:\Users\user\anaconda3\Scripts\
In Bash, when I enter something such as conda info --base I get conda: command not found
However, when I run the same command in Git Bash, it runs just fine.
From within git bash, you can type, command -v conda, as it will output the location to the executable. Add the directory to your PATH environment variable.
Eg from within git bash:
$ command -v my_command
/c/path/to/bin/my_command
Then prefix the value with /mnt and add it all: /mnt/c/path/to/bin to your PATH environment variable. And reopen your bash shell.
you can:
use git-bash / PowerShell / CMD for Anaconda
use Windows Terminal for easily using multiple shells
modify ~/.profile to include the Anaconda folders to PATH. /mnt/c/Users/user/Anaconda3...
NB you may experience issues with file paths or output
in advance, you could check the output of echo "${PATH//:/$'\n'}" | grep -i conda in a new session of bash
because typically, Windows and WSL should have already configured this for you
install Anaconda on WSL following official Linux instructions for your distro
if unsure which distro, it's likely Ubuntu. so instructions for Debian, the parent of Ubuntu
WSL is a complete Linux virtual machine and not your best bet for running (cli) software that you installed on Windows. you can but i would personally prefer installing the Linux version in WSL.

I got error Internal or external command error by command prompt only, but it is fine in anaconda prompt. Why?

If I want to open a jupyter notebook by command prompt I got below error:
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
And also, I want to use pip commands, I got the same error:
'pip' is not recognized as an internal or external command,
operable program or batch file.
But in anaconda prompt I did not get any error it is run finely. I can open jupyter notebook without any error and also I can run pip without any error to install packages.
What can I do for command prompt to overcome this error?
Anaconda Prompt adds the path to the Anaconda binaries (jupiter, pip, etc.) to the PATH environment variable, so you can run them as commands from the prompt.
To be able to run the commands from the "normal" prompt you can manually add the path to the corresponding binaries to the PATH environment variable. Or choose the corresponding option while installing Anaconda (see Step 8 in the installation instructions).
Note the recommendation in the docs:
We do not recommend adding Anaconda to to the PATH environment variable, since this can interfere with other software. Instead, use Anaconda software by opening Anaconda Navigator or the Anaconda Prompt from the Start Menu.

I have added conda and python path to the environment variable, but jupyter notebook is still not getting opened from cmd

I was trying to add conda and python to the environment variable using SETX Command from CMD but it was failing. I tried setting it using PowerShell and it worked. The path was added successfully but I still can't open Jupyter Notebook from my cmd.
Adding Python to the environment path is bad practice, see Anaconda FAQ. If you haven't installed Anaconda with it's default settings, you first need to:
Initialize your shells
conda init --all
After this you should have ../Anaconda3/condabin only in your path (more information via conda init --help).
But before you can run Jupyter, you also need to activate Anaconda:
C:\> conda activate
(base) C:\> jupyter notebook
The activation will add the following folders of the conda base environment to your PATH:
\Anaconda3;
\Anaconda3\Library\mingw-w64\bin;
\Anaconda3\Library\usr\bin;
\Anaconda3\Library\bin;
\Anaconda3\Scripts;
\Anaconda3\bin;
The python.exe resides in Anaconda3, jupyter.exe in Anaconda3\Scripts, so it's not enough to just add the first folder to your Path. And it's especially important to have the libraries on your Path when you want to run C-based packages like numpy.
But the very point behind the conda activate mechanism is that it allows you to configure and run different environments with different versions of python and 3rd party packages that would otherwise conflict, see Managing environmnts.
On top of that you can even install Python from python.org next to your Anaconda distribution, since conda will make sure that they won't interfere.

Anaconda continue installation on Linux

I was installing anaconda for my Ubuntu 18.04 machine but I happened to exit the terminal accidentally after a couple of hours. I wish to resume the installation process at that step where it was installing various packages like sklearn, qt, etc.
I get the following error when I run bash Anaconda3-2018.12-Linux-x86_64.sh and give the path where I want my conda home to be (not the default home folder)
ERROR: File or directory already exists: '<path_to_anaconda>/anaconda3'
If you want to update an existing installation, use the -u option.
How do I approach this error? How do I recover from partial installation?
Also conda update --all gives an error conda:command not found

conda not recognized as an internal or external command

I've installed Anaconda and now I want to create a conda environment,
C:> conda create -n tensorflow pip python=3.5
but then I get the error that "conda" is not recognized as an internal or external command.
How can I fix this?
As Windows user you have to start a Anaconda Prompt from the start menu. Look in your start menu for anaconda3-64bit -> anaconda prompt.
Now the conda command should be found in this shell.
Otherwise add the Anaconda Binaries folder to your environment path.

Resources