How to use CMD for Python in Windows 10 Last Updated : 21 Jun, 2025 Comments Improve Suggest changes Like Article Like Report Want to run Python programs directly from the Command Prompt? This guide will walk you through how to run Python in CMD, configure the environment, and troubleshoot common issues. By mastering these steps, you’ll streamline your development process and save time during testing.Steps to Use CMD for Python in Windows 10Find the detailed steps to use CMD for Python in Windows. Also, these steps will make you proficient in using CMD for your Python projects, enhancing your development efficiency and control.Step 1: Check Python InstallationFor setting up Python on CMD, we must check whether Python is installed on your machine or not. To do this, go to the Windows search bar and search for Python. If you find Python in the result, then you are good to go.You can see Python3 is installed on my computerNote: If Python is not installed on your computer, then it can be installed with How to Install Python on Windows Step 2: Check Python Setup Now check whether Python is already set up in Command Prompt or not. For doing this just open cmd and type python. If you see any Python version then it is already setup. You can see after typing Python nothing happened. So, python is not set up on cmd yet.Step 3: Open IDLE Python File LocationNow open the Windows search bar and search for "idle". Without opening the app click on "Open file location". If you didn't get the option right click on the app and you will get it.Now a file location will be opened on Windows Explorer.Step 4: Open IDLE File LocationNow right-click on "IDLE" and click on "open file location"Click on "Open file location"After opening the file location copy the path.Copy the location Step 5: Search Environment variablesNow go to the Windows search bar and search for "Environment variables" and open it.Open this After opening the menu click on "Environment Variables"Click on the "Environment Variables"Now double-click on the "path" in the "System Variables"In the "Edit System Variable" menu click on "new", then paste the file location you copied and click ok.Now close the Environment menus by clicking ok and congratulations, we have set up the Command Prompt for Python.Step 6: Open CMDNow check whether it works. Open Command Prompt and type "python" and hit enter. You will see a python version and now you can run your program there.ConclusionLearning how to use CMD for Python in Windows 10 is a valuable skill that allows you to run and test your Python code quickly and efficiently. By understanding how to set up and navigate the Python command line in Windows 10, you can streamline your workflow and focus more on writing code rather than dealing with setup issues. Whether you're a beginner or an experienced developer, these skills will make your Python development process smoother and more effective. Comment More infoAdvertise with us Next Article How to Install CMake for Windows in Python? S santanunandi01 Follow Improve Article Tags : Python Windows 10 Tricks How To Command Prompt Practice Tags : python Similar Reads How to use CMD for Python in Windows 10? Want to run Python programs directly from the Command Prompt? This guide will walk you through how to run Python in CMD, configure the environment, and troubleshoot common issues. By mastering these steps, youâll streamline your development process and save time during testing.Steps to Use CMD for P 4 min read How to Install CMake for Windows in Python? CMake is a cross-platform free and open-source software tool for managing the build process of software using a compiler-independent method. It supports directory hierarchies and applications that depend on multiple libraries. Installation of CMake CMake in Python can be easily installed with the us 1 min read How to update Python on Windows? In this article, we are going to see how to update Python in the Windows system. For the sake of example, we will be upgrading from Python 3.6.8 to Python 3.9.6. Here, we will see how to upgrade the Python version.Upgrading Python on WindowsTo check the current version of Python on your system, use 3 min read How to Install PyQt for Python in Windows? In this article, we will be looking at the stepwise procedure to install the PyQt for python in Windows. PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. Features of PyQt: There ar 2 min read How to Setup Sublime Text 3 for Python in Windows? Written by a Google engineer sublime text is a cross-platform IDE developed in C++ and Python. It has basic built-in support for Python. Sublime text is fast and you can customize this editor as per your need to create a full-fledged Python development environment. You can install packages such as d 2 min read How to add Python to Windows PATH? Python is a great language! However, it doesnât come pre-installed with Windows. Hence we download it to interpret the Python code that we write. But wait, windows donât know where you have installed the Python so when trying to any Python code, you will get an error. We will be using Windows 10 and 2 min read Like