Skip to content

Miniconda is a lightweight version of Anaconda that helps you quickly install Python and various packages. It's more suitable for beginners to run AI programs than the full Anaconda distribution.

This tutorial will guide you step-by-step on how to install Miniconda on Windows 10, using the official download link, configure a Python 3.10 environment, and install some commonly used modules. Don't worry, even if you're completely new to this, you can easily handle it!


Step 1: Download and Install Miniconda

  1. Download Miniconda

  2. Install Miniconda

    • Double-click the downloaded file to open the installation window.

    • Click "Next" and agree to the license agreement (click "I Agree").

    • Important: On the "Advanced Options" page, check Add Miniconda3 to my PATH environment variable. This allows you to use the conda command directly. Otherwise, you might encounter the error conda is not recognized as an internal or external command, operable program or batch file.

    • Note: Some computers may warn that adding to PATH is not recommended. Ignore this and check the box. This is a common pitfall for beginners, as the commands won't work later if you don't check it.

  • Click "Install" and wait for a few minutes. Once finished, click "Finish".

Step 2: Verify Installation and Create a Python 3.10 Virtual Environment

  1. Open the Command Prompt (CMD)

    • Press the Windows key + R on your keyboard to open the "Run" window.
    • Type cmd and press Enter to open the black command-line window.
  2. Verify that Miniconda is installed correctly

    • In the command prompt, type: conda --version Press Enter. If you see something like conda 25.1.1, the installation was successful.

If you get a "not recognized" error, it means the environment variable wasn't added. Reinstall and check Add Miniconda3 to my PATH environment variable. 3. Create a Python 3.10 virtual environment

  • In the command prompt, type: conda create -n myai python=3.10
  • myai is the name of the environment and can be anything you like (e.g., ai_env).
  • After pressing Enter, the system will download Python 3.10 and some basic packages. During the process, it will ask you "Y/N". Type y and press Enter to continue the installation.

  1. Activate the virtual environment
    • Type: conda activate myai Press Enter. If (myai) appears at the beginning of the command line, you have successfully entered the environment.

  1. Common virtual environment commands
    • Exit the environment: Type conda deactivate and press Enter. The (myai) will disappear when you exit.
    • View all environments: Type conda env list to see a list of the environments you've created.
    • Delete an environment (if you don't need it): Type conda env remove -n myai to delete it.

Step 3: Install Modules using pip and requirements.txt

  1. Make sure you're in the virtual environment

    • Type conda activate myai and confirm that the command line shows (myai).
  2. Install a common module as a test

    • For example, install numpy (a mathematical computing tool used by many AI software packages): pip install numpy Press Enter. After downloading and installing, you can check the version using python -c "import numpy; print(numpy.__version__)".
  3. Install from requirements.txt

    • If your AI software provides a requirements.txt file (listing the required packages), copy it to a folder (e.g., a new "AIProject" folder on your desktop).
    • Navigate to the folder, then delete the contents of the folder's address bar, type cmd, and press Enter to open a terminal window:

  • Then type: pip install -r requirements.txt Press Enter, and it will automatically install all the packages listed in the file.

Step 4: Common pip Commands and Troubleshooting

  1. Common pip commands

    • Check pip version: pip --version to see if it's the latest.
    • Update pip: If the version is old, type pip install --upgrade pip to update it.
    • List installed packages: pip list to see what you've installed.
    • Uninstall a package: For example, pip uninstall numpy to remove it if you don't need it.
  2. Common errors and solutions

    • Network errors (slow downloads or failures):

      • This could be a network issue. Try again a few times, or use a domestic mirror to speed up the download: pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
    • Permission errors (Access Denied):

      • Run CMD as an administrator: Right-click the "Start" menu, select "Command Prompt (Admin)", and try the command again.
    • Dependency conflicts (incompatible versions):

      • If you get a conflict error, try updating pip (pip install --upgrade pip) and then reinstalling. If that doesn't work, ask the software author for the recommended versions.
    • Invalid command:

      • If pip isn't working, try python -m ensurepip and python -m pip install --upgrade pip to fix it.

Now Miniconda is installed, the Python 3.10 environment is configured, and you can install various required packages. If your AI software has running instructions (e.g., python run.py), enter the corresponding command in the virtual environment (with (myai) showing).