Anaconda Prompt: How to Open It and Run Python
Anaconda Prompt is a Windows command-line shell configured to use conda, letting you manage Python environments and run programs without manually editing PATH. You normally open it by searching for Anaconda Prompt in the Windows Start menu. This guide covers installation, everyday commands, running a Python file, and opening a working conda shell when the shortcut is missing.
What Anaconda Prompt Does
Anaconda Prompt usually opens Windows Command Prompt with conda’s shell setup loaded. That setup makes environment activation work and helps the shell find the Python interpreter and packages belonging to your selected environment.
These names refer to different parts of the setup:
- Anaconda Distribution includes Python, conda, and a collection of tools and packages.
- Miniconda is a smaller installer containing conda, Python, and a minimal set of packages.
- Conda manages packages and environments.
- Anaconda Prompt is the command-line interface you use to run conda and other commands.
- Anaconda Navigator is a graphical application for managing environments and launching tools.
Anaconda Prompt is not the Python interpreter. You enter shell commands at a prompt that usually ends with >. If you see >>>, you are inside interactive Python instead.
You may also see (base) at the beginning of the shell prompt. That identifies the active conda environment; it is not something you type.
How to Open and Use Anaconda Prompt on Windows
The starting options are an existing prompt, Anaconda Distribution with bundled tools, or a minimal Miniconda installation:
| Your Situation | Best Starting Point |
|---|---|
| Anaconda or Miniconda is already installed | Open the existing prompt; do not install another copy just to obtain a shortcut. |
| You want Python with bundled data-science tools | Install Anaconda Distribution. |
| You want a minimal setup and will add packages yourself | Install Miniconda. |
Step 1: Install Anaconda If Needed
Before organizational use, check licensing: Anaconda requires a paid business license for use of its offerings at an organization with more than 200 employees/contractors, unless the organization is eligible for discounted or free use.
If Anaconda or Miniconda is already installed, keep that installation. Otherwise:
- Download the Windows installer for Anaconda Distribution or Miniconda from Anaconda’s official download page.
- Run the installer. For an installation used only by your Windows account, choose Just Me rather than an all-users installation.
- Leave
Add Anaconda3 to my PATH environment variableunchecked. The dedicated prompt supplies the environment configuration you need without making Anaconda compete globally with other Python installations. - Select
Register Anaconda3 as my default Python 3.xonly if you want compatible Windows applications to discover Anaconda as your default Python installation. Leave it unchecked if you need to preserve another Python registration. - Finish the installation.
Registering a default Python and adding Python to PATH are separate settings. Neither setting needs to be enabled merely to use Anaconda Prompt.
Step 2: Open the Prompt and Check Conda
- Press the Windows key and search for Anaconda Prompt.
- Open Anaconda Prompt or Anaconda Prompt (Anaconda3). The label varies by installation; the Windows Start menu for your installed Anaconda version shows the exact name.
- Check that conda responds:
conda --version - Check that Python responds:
python --version
The python –version command should print a Python version rather than a “not recognized” error. Your installed versions do not need to match an example from a tutorial.
Type the command itself, not the environment name, directory, or prompt symbols displayed before your cursor.
Step 3: Create and Activate a Project Environment
A separate environment keeps a project’s packages apart from those used by other projects.
- Create an environment named
demowith Python:conda create --name demo pythonUse another environment name if
demoalready exists and you want a fresh environment. Review the proposed package changes and enterywhen asked to proceed. - Activate the environment:
conda activate demo
The prompt will normally begin with (demo). From this point, Python and package operations in this shell should use that environment.
Activation applies to the current shell session. Opening another terminal does not necessarily activate the same project environment.
Step 4: Install a Package
With demo active, install NumPy:
conda install numpy
Review and confirm the package plan. Conda resolves the package’s dependencies and installs them into the active environment.
Wait for the normal shell prompt to return before entering the next command. If installation fails, read the error rather than assuming the package is available; an interrupted or rejected transaction is not a successful installation.
Step 5: Run a Python File
Create a folder named conda-prompt-demo in your Windows user folder for this example. The script will print its Python executable’s path and NumPy version.
- Create an example folder under your Windows user directory:
mkdir "%USERPROFILE%\conda-prompt-demo"If that folder already exists, you can use it without creating it again.
- Change to the folder:
cd /d "%USERPROFILE%\conda-prompt-demo"In Windows Command Prompt,
/dchanges both the drive and directory when necessary. Quotes keep paths containing spaces together. - Open a new Python file in Notepad:
notepad hello.py - Add this Python code:
import sys import numpy as np print("Hello from Anaconda Prompt") print("Python:", sys.executable) print("NumPy:", np.__version__)Save the file as
hello.py, nothello.py.txt, and close Notepad. If you use Save As, select All Files so Notepad does not append a text-file extension. - Run the file:
python hello.py
You should see the greeting, the path to the Python executable, and the installed NumPy version. The normal shell prompt should return when the script finishes.
For an existing project, change to the directory containing its script and run that script’s filename instead. Merely changing directories does not activate the project’s environment.
Step 6: Stop a Program and Close the Prompt
If a program is still running, press Ctrl+C to request an interruption. Wait for the shell prompt to return; some programs ask you to confirm shutdown.
If you are at Python’s >>> prompt, leave the interpreter first:
exit()
To leave the active project environment:
conda deactivate
To close the command-line window:
exit
Deactivating an environment does not uninstall it or remove its packages. Closing the prompt also leaves the environment available for future sessions.
Fix a Missing Anaconda Prompt Shortcut
A missing Start menu shortcut does not, by itself, mean conda is missing.
Anaconda and Miniconda installations can lack searchable launchers. Double-clicking conda.exe can fail or open a window that immediately disappears; it is not a useful test of whether the installation works.
On Windows, you can activate the base environment through condabin\conda.bat from an ordinary Command Prompt.
- Open File Explorer and locate your installation directory. Possible locations include
anaconda3orminiconda3under your Windows user folder, but an installer or administrator may have chosen another location. - Confirm that the installation contains
condabin\conda.bat. - Search the Start menu for Command Prompt and open it normally.
- Run the activation command using the installation’s actual path. For an Anaconda installation at
%USERPROFILE%\anaconda3, use:call "%USERPROFILE%\anaconda3\condabin\conda.bat" activate baseFor Miniconda, replace
anaconda3withminiconda3if that is the folder you found. If the installation is elsewhere, replace the directory portion with its actual location. - Confirm that conda and Python now work:
conda --versionpython --version
Successful version output confirms that you have a usable conda shell even without the Start menu shortcut. This activation affects the current Command Prompt session; it does not recreate a launcher or permanently configure every terminal.
If Windows says the specified path cannot be found, check the installation directory and batch-file location before changing PATH or reinstalling anything.
Use Conda in Command Prompt or PowerShell
If conda works in Anaconda Prompt but a regular terminal says it is not recognized, the installation is probably usable. The regular shell has not been configured for it.
Conda’s initialization command configures shell startup behavior so that environment activation works. It changes shell startup settings or profile files, so initialize the shell you actually intend to use.
- Run the initialization command from Anaconda Prompt or another prompt where conda already works:
- Run the command for your preferred Windows shell. For ordinary Command Prompt:
conda init cmd.exeFor PowerShell:
conda init powershellThe Command Prompt and PowerShell commands are alternatives. You do not need to initialize both shells unless you use both.
- Close the target shell’s existing windows and open a fresh window of that shell.
- Activate the base environment:
conda activate base - Check which Python executable the shell now uses:
python -c "import sys; print(sys.executable)"
The printed path should belong to the conda installation’s base environment. You can now activate project environments from that shell.
If PowerShell reports that profile scripts are blocked, do not bypass an organization’s execution policy just to enable conda. Use Anaconda Prompt or a configured Command Prompt instead, or have the policy reviewed through the appropriate administrator.
Windows Terminal is a terminal host, not a replacement for these shells. Whether conda works in a Windows Terminal tab depends on the Command Prompt or PowerShell profile running inside that tab.
Confirm the Right Python Environment Is Running
A working conda command does not guarantee that you have selected the environment your project needs. Check both the environment and the interpreter when troubleshooting missing packages or unexpected Python versions.
List the environments:
conda info --envs
An asterisk marks the active environment. The output also shows each environment’s location, which is useful when custom installation directories or multiple conda installations are involved.
Then inspect the interpreter actually running your code:
python -c "import sys; print(sys.executable)"
Confirm that the project uses the intended environment and interpreter and that its script runs correctly:
- The active environment is the one intended for the project.
- The Python executable belongs to that environment.
- Your script can import its required packages.
- The script completes or stays running as expected, without an unexplained traceback.
If the environment marker looks right but the executable path does not, investigate another Python installation or a shell configuration conflict before installing more packages. Adding packages to the wrong environment will not fix the interpreter mismatch.
For future projects, keep project-specific dependencies in named environments rather than adding everything to base. Once these checks pass, run your project’s normal entry point from the active environment.
Frequently Asked Questions
How Do I Open the Anaconda Menu?
Anaconda’s graphical application is Anaconda Navigator; there is no separate graphical menu inside Anaconda Prompt. Search for it in the Windows Start menu, or run this in an environment where Navigator is installed:
anaconda-navigator
Navigator is included with Anaconda Distribution, but it is not part of a minimal Miniconda installation by default.
How Do I Launch JupyterLab From Anaconda Prompt?
Create a dedicated environment containing JupyterLab, reviewing and accepting the package plan when prompted:
conda create --name notebooks python jupyterlab
Activate the environment, then start the server:
conda activate notebooks
jupyter lab
JupyterLab normally opens in your browser and also prints a local access URL in the terminal. Keep the terminal open while working; to stop the server, press Ctrl+C and confirm shutdown if prompted.
Where Is Anaconda Prompt on macOS or Linux?
Use the normal Terminal application on macOS or Linux; you do not need a separate Windows-style Anaconda Prompt. After conda is installed and initialized for your shell, its environment and package commands work in that terminal. Windows-specific commands and paths in examples need to be adapted to your operating system.
How do you download Anaconda and get Anaconda Prompt on a laptop?
Download the Anaconda installer from the official download page after choosing the operating system your laptop uses. On Windows, finish the installation and run `conda –version` to confirm that conda is available. The Windows installer offers a current-user installation or an all-users installation, which requires administrator privileges.
