Home Backend Development Python Tutorial Set up Python compilation environment in Windows environment

Set up Python compilation environment in Windows environment

Apr 16, 2018 am 11:26 AM
python windows

The content of this article is to build a Python compilation environment in the Windows environment. It has certain reference value. Now I share it with you. Friends in need can refer to it

Windows Not all systems have Python installed by default, so you may need to download and install it, and then download and install a
text editor (using the previous PyCham: click to open the link).
1. Install Python
First, check whether Python is installed on your system. To do this, type command in the Start menu and press Enter to open a command window; you can also hold down the Shift key and right-click on the desktop and select "Open command window here." Enter python in the terminal window
and press Enter; if the Python prompt (>>>) appears, it means that Python is installed on your system. However,
you may also see an error message stating that python is an unrecognized command.
If this is the case, you will need to download the Windows Python installer. To do this, visit http://python.org/downloads/.
You will see two buttons for downloading Python 3 and Python 2. Click the button to download Python 3, which will automatically download the correct installer for your system. After downloading the installer, run it. Be sure to select the checkbox Add Python to


PATH (shown in Figure 1-2), which makes it easier to configure your system.


2. Start a Python terminal session

Simplify text editor configuration by configuring the system to run Python in a terminal session. Open a

command window and execute the command python in it. If the Python prompt (>>>) appears, it means that Windows has found the Python version you just installed.

C:\>  python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 22:15:05) [MSC v.1900 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Copy after login

If so, you can skip directly to the next section - "Running Python in a Terminal Session".
However, the output may look like this:

C:\>  python
'python' is not recognized as an internal or external command, operable
program or batch file.
Copy after login

In this case, you will have to tell Windows how to find the version of Python you just installed. The command python is usually
stored in the C drive, so please open the C drive in Windows Explorer, find and open the folder starting with Python, and

then find the file python. For example, in my computer, there is a folder called Python35, which has a file called python

, so the path of the file python is C:\Python35\python. If you can't find this file, enter python in the Windows Resource Manager's search box. This will allow you to know exactly where the command python is stored on your system.
If you think you know the path to the command python, enter the path in the terminal window to test. To do this, open a


command window and enter the full path you determined:

C:\>  C:\Python35\python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 22:15:05) [MSC v.1900 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Copy after login

If this works, you already know how to access Python.

3. Run Python in a terminal session

Execute the following command in the Python session and confirm that you see the output "Hello Python world!".

>>>  print("Hello Python world!")
Hello Python world!
>>>
Copy after login

Whenever you want to run a Python code snippet, open a command window and start a Python terminal session. To close the terminal session, press Ctrl Z and then press the Enter key, or execute the command exit().



Related recommendations:


Building a Python programming environment in Windows systems

Building Python environment under windows system

Building python nltk development environment under windows environment

The above is the detailed content of Set up Python compilation environment in Windows environment. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS Aug 26, 2024 am 10:07 AM

Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS

How to download deepseek Xiaomi How to download deepseek Xiaomi Feb 19, 2025 pm 05:27 PM

How to download deepseek Xiaomi

deepseek web version entrance deepseek official website entrance deepseek web version entrance deepseek official website entrance Feb 19, 2025 pm 04:54 PM

deepseek web version entrance deepseek official website entrance

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? Feb 21, 2025 pm 10:54 PM

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated?

How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

How to install deepseek

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Mar 05, 2025 pm 05:57 PM

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node?

How do you ask him deepseek How do you ask him deepseek Feb 19, 2025 pm 04:42 PM

How do you ask him deepseek

How to search deepseek How to search deepseek Feb 19, 2025 pm 05:18 PM

How to search deepseek

See all articles