How to Install Python on Windows

Configurare noua (How To)

Situatie

Python doesn’t come prepackaged with Windows, but that doesn’t mean Windows users won’t find the flexible programming language useful. It’s not quite a simple as installing the newest version however, so let’s make sure you get the right tools for the task at hand on Windows 10 or Windows 11.

Solutie

Which Python Version Should You Use?

In general, you should just download and install the latest version of Python. You’ll see a big banner at the top indicating the latest version of Python on the main download page. Click “Download Python 3.x.x.”

The latest download available for Windows.

Unfortunately, there was a significant update to Python several years ago that created a big split between Python versions. This can make things a bit confusing to newcomers, but here is what you need to know.

There were two versions of Python maintained concurrently for many years: Python 2 and Python 3. Python 2 is officially deprecated. and has been since 2020. You’ll still find loads of older projects that use it scattered around the internet, though the overwhelming majority of new projects opt for Python 3 since it is still receiving updates.

If you’re looking to learn Python, you should skip Python 2 entirely and stick to Python 3. There are some noteworthy technical differences between Python 2 and 3. Suffice it to say, Python 3 is typically easier to read and write, faster, and has more community support than Python 2. They’re also similar enough that learning Python 3 will enable you to work with Python 2 without too much of a problem, if it is absolutely necessary.

You’ll see the division if you scroll down a bit when you visit the Python for Windows download page.

Multiple Python versions are still available.

You can download just Python 2 or Python 3 if you’re sure you only need a particular version. We’re going to be showing you how to install the latest version of Python 3, however the installation process for Python 2 is basically the same.

How to Install Python 3

First, download the latest version of Python 3 if you haven’t already, then run the executable.

Note: You can install the latest version of Python 3 alongside Python 2 or even older versions of Python 3 with no problems. Just make sure the right one is on your PATH.

On the first screen, enable the “Add Python.exe PATH” option and then click “Install Now.”

Next, you have a decision to make. Clicking the “Disable path length limit” option removes the limitation on the MAX_PATH variable. This change won’t break anything, but will allow Python to use long path names. Since many Python programmers are working in Linux and other *nix systems where path name length isn’t an issue, turning this on in advance can help smooth over any path-related issues you might have while working in Windows.

We recommend go ahead and selecting this option. If you know you don’t want to disable the path length limit, you can just click “Close” to finish the installation. And, if you want to read more about the issue before committing to the change, read up here.

If you’re only installing Python 3, you can run python –version in any command line (like PowerShell or Command Prompt) to check that it is installed, and the path variable is set. If everything worked correctly, you’ll see the version of Python you just installed shown.

Enter "python --version" in Command Prompt, PowerShell, or Windows Terminal to verify that Python was correctly added to the path.

Tip solutie

Permanent

Voteaza

(2 din 5 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?