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 AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

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)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1261
29
C# Tutorial
1234
24
PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

Choosing Between PHP and Python: A Guide Choosing Between PHP and Python: A Guide Apr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Python: A Deep Dive into Their History PHP and Python: A Deep Dive into Their History Apr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

How to run sublime code python How to run sublime code python Apr 16, 2025 am 08:48 AM

To run Python code in Sublime Text, you need to install the Python plug-in first, then create a .py file and write the code, and finally press Ctrl B to run the code, and the output will be displayed in the console.

How to run python with notepad How to run python with notepad Apr 16, 2025 pm 07:33 PM

Running Python code in Notepad requires the Python executable and NppExec plug-in to be installed. After installing Python and adding PATH to it, configure the command "python" and the parameter "{CURRENT_DIRECTORY}{FILE_NAME}" in the NppExec plug-in to run Python code in Notepad through the shortcut key "F6".

Golang vs. Python: Key Differences and Similarities Golang vs. Python: Key Differences and Similarities Apr 17, 2025 am 12:15 AM

Golang and Python each have their own advantages: Golang is suitable for high performance and concurrent programming, while Python is suitable for data science and web development. Golang is known for its concurrency model and efficient performance, while Python is known for its concise syntax and rich library ecosystem.

How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! Apr 17, 2025 pm 09:54 PM

In Laravel development, dealing with complex model relationships has always been a challenge, especially when it comes to multi-level BelongsToThrough relationships. Recently, I encountered this problem in a project dealing with a multi-level model relationship, where traditional HasManyThrough relationships fail to meet the needs, resulting in data queries becoming complex and inefficient. After some exploration, I found the library staudenmeir/belongs-to-through, which easily installed and solved my troubles through Composer.

Golang vs. Python: Performance and Scalability Golang vs. Python: Performance and Scalability Apr 19, 2025 am 12:18 AM

Golang is better than Python in terms of performance and scalability. 1) Golang's compilation-type characteristics and efficient concurrency model make it perform well in high concurrency scenarios. 2) Python, as an interpreted language, executes slowly, but can optimize performance through tools such as Cython.

See all articles