difference between command prompt and anaconda prompt - python

I installed anaconda into my computer using python. After I install the software, I found there is one program called anaconda prompt.
What is the difference between anaconda prompt and command prompt? If I want to update the package, which one I should use or either one. Like (conda update conda)
Thank you

Anaconda command prompt is just like command prompt, but it makes sure that you are able to use anaconda and conda commands from the prompt, without having to change directories or your path.
When you start Anaconda command prompt, you'll notice that it adds/("prepends") a bunch of locations to your PATH. These locations contain commands and scripts that you can run. So as long as you're in the Anaconda command prompt, you know you can use these commands.
During the installation of Anaconda there is a choice to add these to the PATH by default, and if checked you can also use these commands on the regular command prompt. But the anaconda prompt will always work.
As far as updating conda, if it doesn't work in command prompt, you can do
conda update conda
in Anaconda command prompt.

When you use anaconda command prompt it opened at conda directory (path where all the conda commands run)
like when I was installing pip3 install prettytable on command prompt it successfully installed but not replicate in jupyter notebook.
But when install it using anaconda prompt it replicates intantly

Here is the difference:
PATH-TO behind is the path to Anaconda3
Afer adding the following env to Windows command prompt, it will be the same as Anaconda prompt:
set CONDA_DEFAULT_ENV=base
set CONDA_PREFIX=PATH-TO\Anaconda3
set CONDA_EXE=%CONDA_PREFIX%\Scripts\conda.exe
set CONDA_PROMPT_MODIFIER=(base)
set CONDA_PYTHON_EXE=%CONDA_PREFIX%\python.exe
set CONDA_SHLVL=1
set Path=%CONDA_PREFIX%;%CONDA_PREFIX%\Library\mingw-w64\bin;%CONDA_PREFIX%\Library\usr\bin;%CONDA_PREFIX%\Library\bin;%CONDA_PREFIX%\Scripts;%CONDA_PREFIX%\bin;%CONDA_PREFIX%\condabin;%Path%

I see great answers but maybe it is a little technical for beginners. Anaconda is a (software) distributor, in this case for Python, and its anaconda command prompt is similar to windows command prompt with one important difference: having PATH. PATH, as it can be assumed from its name, is like an address in computer where python packages are installed and their computations will be run.
Having PATH makes a big difference between using python via anaconda prompt or normal command prompt which is considered useful for many research teams and business computers: it will allow you to install, update and uninstall packages inside a separate environment (after creating one!) so that other members of the team wouldn't be disturbed.
When I was working with my own laptop, I never had any problem with running python on jupyter using windows command prompt. But for working with a research team PC, my supervisor made me to create a virtual environment named after me in anaconda prompt just not to disturb any other member. Actually, that was a pain in my neck because I have to activate "my environment" every time before starting python on jupyter. I never understand why someone should not appreciate if I install any more extra packages or updates for them? Not to mention, if in a million years an error pops up due to a package I installed, they can simply uninstall or downgrade it.
So as a normal researcher with medium computations in python, I never liked working with anaconda prompt and windows command prompt was everything I needed, especially on my OWN laptop.
I hope you liked my idea.

Related

Windows: conda recognized, python is not

When I try to use python from either command prompt or windows powershell, I get the error that "Python was not found". This started happening after I recently reinstalled Anaconda, which is how I install and manage python and related packages.
What's odd is that "conda --version" works fine in command prompt. Also, "python --version" works fine in Anaconda prompt. But, I have added the output of "where python" in the Anaconda prompt to the user variable "Path" under environment variables, along with the outputs of "where conda". I'll note that this is within my user directory, which contains a space in the name, but the same is true for the conda path definition and that seems to work just fine.
Windows 10 Enterprise, conda 4.10.3, python 3.9.7. Thanks.
I may have already answered my own question, though I don't fully understand why the fix was needed.
I tried "conda activate base" in powershell and it failed and told me to run "conda init ", which I did and then restarted powershell. It now opens in the base environment and things seem to work fine now. I don't remember having to do this before, I think because an anaconda update (applied when I reinstalled) made using an environment required whereas it wasn't before. Not sure that's the right explanation so I'll leave this up for a bit, but this did seem to fix my issue.

Different versions of Python, packages and many terminals in Anaconda

I am using Windows 7 and already installed Python version 3.8.10. After installing Anaconda 4.9.0, I open Jupyter Notebook and see that Python has a brother, version 3.8.3. Should I remove one?
Not only that, all Python packages in Jupyter have different versions than existing ones. I also find out now there are a lot more terminals: one is from drop-down "New", one is called Anaconda prompt and the last one is Anaconda Powershell prompt, not to mention the usual windows terminal.
Can anyone please give a simple explanation about this and please indicate which terminal should I use to install and upgrade packages for Jupyter Notebook?
Been a while I used windows, but I'll tell you this. Anaconda is a suite of tools and you don't have to use everything. Anaconda prompt and Anaconda Powershell are basically the same, it's just that the Anaconda prompt uses a Windows command prompt while the other uses a Windows Powershell as a base.
I'll say use the Anaconda prompt since it should feel more welcoming and easy to use.

Basic python commands no longer recognised in VS Code [duplicate]

I installed Anaconda3 4.4.0 (32 bit) on my Windows 7 Professional machine and imported NumPy and Pandas on Jupyter notebook so I assume Python was installed correctly. But when I type conda list and conda --version in command prompt, it says conda is not recognized as internal or external command.
I have set environment variable for Anaconda3; Variable Name: Path, Variable Value: C:\Users\dipanwita.neogy\Anaconda3
How do I make it work?
I was faced with the same issue in windows 10, Updating the environment variable following steps, it's working fine.
I know It is a lengthy answer for the simple environment setups, I thought it's may be useful for the new window 10 users.
1) Open Anaconda Prompt:
2) Check Conda Installed Location.
where conda
3) Open Advanced System Settings
4) Click on Environment Variables
5) Edit Path
6) Add New Path
C:\Users\RajaRama\Anaconda3\Scripts
C:\Users\RajaRama\Anaconda3
C:\Users\RajaRama\Anaconda3\Library\bin
7) Open Command Prompt and Check Versions
8) After 7th step type
conda install anaconda-navigator in cmd then press y
Although you were offered a good solution by others I think it is helpful to point out what is really happening. As per the Anaconda 4.4 changelog, https://docs.anaconda.com/anaconda/reference/release-notes/#what-s-new-in-anaconda-4-4:
On Windows, the PATH environment variable is no longer changed by default, as this can cause trouble with other software. The recommended approach is to instead use Anaconda Navigator or the Anaconda Command Prompt (located in the Start Menu under “Anaconda”) when you wish to use Anaconda software.
(Note: recent Win 10 does not assume you have privileges to install or update. If the command fails, right-click on the Anaconda Command Prompt, choose "More", chose "Run as administrator")
This is a change from previous installations. It is suggested to use Navigator or the Anaconda Prompt although you can always add it to your PATH as well. During the install the box to add Anaconda to the PATH is now unchecked but you can select it.
I found the solution.
Variable value should be C:\Users\dipanwita.neogy\Anaconda3\Scripts
When you install anaconda on windows now, it doesn't automatically add Python or Conda to your path.
While during the installation process you can check this box, you can also add python and/or python to your path manually (as you can see below the image)
If you don’t know where your conda and/or python is, you type the following commands into your anaconda prompt
where python
where conda
Next, you can add Python and Conda to your path by using the setx command in your command prompt (replace C:\Users\mgalarnyk\Anaconda2 with the results you got when running where python and where conda).
SETX PATH "%PATH%;C:\Users\mgalarnyk\Anaconda2\Scripts;C:\Users\mgalarnyk\Anaconda2"
Next close that command prompt and open a new one. Congrats you can now use conda and python
Source: https://medium.com/#GalarnykMichael/install-python-on-windows-anaconda-c63c7c3d1444
Just to be clear, you need to go to the controlpanel\System\Advanced system settings\Environment Variables\Path,
then hit edit and add:
C:Users\user.user\Anaconda3\Scripts
to the end and restart the cmd line
In addition to adding C:\Users\yourusername\Anaconda3 and C:\Users\yourusername\Anaconda3\Scripts, as recommended by Raja (above), also add C:\Users\yourusername\Anaconda3\Library\bin to your path variable. This will prevent an SSL error that is bound to happen if you're performing this on a fresh install of Anaconda.
If you have a newer version of the Anaconda Navigator, open the Anaconda Prompt program that came in the install. Type all the usual conda update/conda install commands there.
I think the answers above explain this, but I could have used a very simple instruction like this. Perhaps it will help others.
Go To anaconda prompt(type "anaconda" in search box in your laptop). type following commands
where conda
add that location to your environment path variables. Close the cmd and open it again
This problem arose for me when I installed Anaconda multiple times. I was careful to do an uninstall but there are some things that the uninstall process doesn't undo.
In my case, I needed to remove a file Microsoft.PowerShell_profile.ps1 from ~\Documents\WindowsPowerShell\. I identified that this file was the culprit by opening it in a text editor. I saw that it referenced the old installation location C:\Anaconda3\.
For conda --version greater than 4.6, from the base of your Anaconda promt, run
conda update conda
conda init
This will update your conda root environment and setup the stuff you need to run it on both cwd and powershell.
After this, you can start any terminal and it will be conda ready.
If you don't want to add Anaconda to env. path and you are using Windows try this:
Open cmd;
Type path to your folder instalation. It's something like:
C:\Users\your_home folder\Anaconda3\Scripts
Test Anaconda, for exemple type conda --version.
Update Anaconda: conda update conda or conda update --all or conda update anaconda.
Update Spyder:
conda update qt pyqt
conda update spyder
I have Windows 10 64 bit, this worked for me,
This solution can work for both (Anaconda/MiniConda) distributions.
First of all try to uninstall anaconda/miniconda which is causing problem.
After that delete '.anaconda' and '.conda' folders from 'C:\Users\'
If you have any antivirus software installed then try to exclude all the folders,subfolders inside 'C:\ProgramData\Anaconda3\' from
Behaviour detection.
Virus detection.
DNA scan.
Suspicious files scan.
Any other virus protection mode.
*(Note: 'C:\ProgramData\Anaconda3' this folder is default installation folder, you can change it just replace your excluded path at installation destination prompt while installing Anaconda)*
Now install Anaconda with admin privileges.
Set the installation path as 'C:\ProgramData\Anaconda3' or you can specify your custom path just remember it should not contain any white space and it should be excluded from virus detection.
At Advanced Installation Options you can check "Add Anaconda to my PATH environment variable(optional)" and "Register Anaconda as my default Python 3.6"
Install it with further default settings. Click on finish after done.
Restart your computer.
Now open Command prompt or Anaconda prompt and check installation using following command
conda list
If you get any package list then the anaconda/miniconda is successfully installed.
I have just launched anaconda-navigator and run the conda commands from there.
For those who didn't check "Add Anaconda to my PATH environment variable". In Windows 10 it looks like that:
5 paths:
C:\Users\shtosh\anaconda3
C:\Users\shtosh\anaconda3\Library\mingw-w64\bin
C:\Users\shtosh\anaconda3\Library\usr\bin
C:\Users\shtosh\anaconda3\Library\bin
C:\Users\shtosh\anaconda3\Scripts
if you use chocolatey, conda is in C:\tools\Anaconda3\Scripts
I had this problem in windows. Most of the answers are not as recommended by anaconda, you should not add the path to the environment variables as it can break other things. Instead you should use anaconda prompt as mentioned in the top answer.
However, this may also break. In this case right click on the shortcut, go to shortcut tab, and the target value should read something like:
%windir%\System32\cmd.exe "/K" C:\Users\myUser\Anaconda3\Scripts\activate.bat C:\Users\myUser\Anaconda3

Anaconda navigator is not opening

I have had this problem for quite some time now. Every time I restart my PC, the anaconda navigator, prompt or any other application don't open. Instead, the python shell opens up. The message in the shell goes like this.
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
Well, I went to the given link and there it said to run conda activate myenv where myenv is the path directory. When I try this out in the terminal, the error message is something like this:
'conda' is not recognized as an internal or external command, operable program or batch file.
Can somebody direct me and help me out?
Make sure you have installed python 2.7 or python 3 version before installing anaconda navigator and also choose appropriate python verion which u have preinstalled...and then select accordingly while installing conda navigator

Anaconda3 activate.bat is not recognized as an internal or external command

I have downloaded Anaconda3 for windows 64-bit operating system. After the download and install completed, I opened the Anaconda prompt but it give me this nice error:
'C:\Anaconda3\Scripts\activate.bat' is not recognized as an internal or external command,operable program or batch file.
I just surfed the internet and found a solution to uninstall all previous packages of python but did not work. I have searched for activate.bat file in my system " found it in one folders of anaconda directory " and copy, paste it to the Scripts folder but it gives me errors with conda packages and dependencies. Any solutions please!!
I cannot run any either jupyter notebook or conda as well. Actually, I do not know how to find them in those bunch of Anaconda files and packages.
Thanks in advance,,,.
This is a known Anaconda bug:
From their Github:
" I have fixed the underlying bug here but we will not release new Anaconda installers for a while.
The fix is in the latest Miniconda installers:
64-bit:
https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe
https://repo.continuum.io/miniconda/Miniconda2-latest-Windows-x86_64.exe
32-bit:
https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86.exe
https://repo.continuum.io/miniconda/Miniconda2-latest-Windows-x86.exe
Install those, then run the Anaconda Prompt and install whatever packages you need. If you want the latest full Anaconda release then use:
conda install anaconda=5.0.1"
Check this github thread for the full answer: https://github.com/conda/conda/issues/6053
When you installing Anaconda3 on Windows 10 and the Anaconda Navigator menu item does not install, and running the Anaconda Prompt gives the activate.bat error.
Delete all instances of the previous python IDEs
Reveal hidden files within the control menu
Go to -> C:\Users[Username] in windows explorer
Delete the files .conda and .anaconda. Possibly others if you had other IDEs.
Go to -> C:\Users[Username]\AppData\Local
Delete all python related files conda, python, ect.. any instances other python IDEs
Go to -> C:\Users[Username]\AppData\Roaming
Delete all python related files conda, python, ect.. any instances other python IDEs
Run the Anaconda installer as Admin and install in a directory such as C:\anaconda3
Sit back and wonder why an install took 4 hours out of my life and start drinking.
At some point I felt like this was a test for the uninitiated... can I start coding now?
I think the problem will be solved by clearing all dependencies. I initially had python installed, 2.7 and 3.6. I just get rid of all of them. The problem is not solved yet.
I discovered that My MySQL server is running. I just closed it but it did not work. I just uninstalled it completely and The problem is solved. Anaconda needs to listen to , I think 8888 port, which might be used also by MySQL server as well.
I hope this will help.
I had the same issue and solved it like this:
Open a command prompt (cmd.exe)
Execute these commands to reset two environment variables:
set PYTHONPATH=
set PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
Start the installer (from within the same command prompt).
Now the installation will succeed!
Tip: if 'Anaconda Prompt' in the start menu isn't working afterwards, use this workaround:
C:\Users\<username>\AppData\Local\Continuum\anaconda3\Scripts\activate.bat C:\Users\<username>\AppData\Local\Continuum\anaconda3
I solved it
If you install other python directories or install anaconda on your drive. remove them all
and visit to C:\Users\<username> and you can find this babies
.anaconda
.conda
Kill them all, reinstall anaconda.
Now it works well.
I uninstalled any previous versions.Restarted system and installed Anaconda again at path C:\Users\xyzuser\Anaconda.It is working now
I solved it with:
0. Rename/delete previous Anaconda3 directory (at c:\ProgramData\Anac...) (show/check hidden items at File Manager to delete it)
1. Re-install Anaconda
2. At Advanced Installation Options, I check both:
2.1. [check] Add Anaconda to my PATH environment variable
2.2. [check] Register Anaconda as my default Python 3.6
3. then click Install button
4. Done
my OS: windows 10, 64bit
I have met exactly the same problem when I was using anaconda 5.3.1 on windows10.
Well, the solution is to uninstall your anaconda and re-install it.
And when you install anaconda, you can't close the exe command window manually which would show up at the end of installing. You should let it run and exit by itself. Only by this way your anaconda would be installed correctly.
The Fix is simple. Here's what you need to do.
Go to--
C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\Scripts\
*Replace USERNAME with your own***
If you are not able to access this location, then directly search in your C drive for Continuum, and from there you can write the rest of the URL
Search for "Activate.bat"
If you are able to find this file, then go to ANACONDA PROMPT and
Change your directory by typing:
cd C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\Scripts\
*Replace USERNAME with your own***
Your directory is now projecting to this new location.
Now type:
activate.bat
Hit enter
Now you activated your Anaconda.
Now, you can check if it is working or not by typing
Conda list

Categories