Windows python download file

Release Date: Dec. 21, 2020

This is the seventh maintenance release of Python 3.8

Note: The release you’re looking at is Python 3.8.7, a bugfix release for the legacy 3.8 series. Python 3.9 is now the latest feature release series of Python 3. Get the latest release of 3.9.x here.

macOS 11 Big Sur not fully supported

Python 3.8.7 is not yet fully supported on macOS 11 Big Sur. It will install on macOS 11 Big Sur and will run on Apple Silicon Macs using Rosetta 2 translation. However, a few features do not work correctly, most noticeably those involving searching for system libraries (vs user libraries) such as ctypes.util.find_library() and in Distutils. This limitation affects both Apple Silicon and Intel processors. We are looking into improving the situation for Python 3.8.8.

Major new features of the 3.8 series, compared to 3.7

  • PEP 572, Assignment expressions
  • PEP 570, Positional-only arguments
  • PEP 587, Python Initialization Configuration (improved embedding)
  • PEP 590, Vectorcall: a fast calling protocol for CPython
  • PEP 578, Runtime audit hooks
  • PEP 574, Pickle protocol 5 with out-of-band data
  • Typing-related: PEP 591 (Final qualifier), PEP 586 (Literal types), and PEP 589 (TypedDict)
  • Parallel filesystem cache for compiled bytecode
  • Debug builds share ABI as release builds
  • f-strings support a handy = specifier for debugging
  • continue is now legal in finally: blocks
  • on Windows, the default asyncio event loop is now ProactorEventLoop
  • on macOS, the spawn start method is now used by default in multiprocessing
  • multiprocessing can now use shared memory segments to avoid pickling costs between processes
  • typed_ast is merged back to CPython
  • LOAD_GLOBAL is now 40% faster
  • pickle now uses Protocol 4 by default, improving performance

There are many other interesting changes, please consult the «What’s New» page in the documentation for a full list.

More resources

  • Online Documentation
  • PEP 569, 3.8 Release Schedule
  • Report bugs at https://bugs.python.org.
  • Help fund Python and its community.

Windows users

  • The binaries for AMD64 will also work on processors that implement the Intel 64 architecture. (Also known as the «x64» architecture, and formerly known as both «EM64T» and «x86-64».)
  • There are now «web-based» installers for Windows platforms; the installer will download the needed software components at installation time.
  • There are redistributable zip files containing the Windows builds, making it easy to redistribute Python as part of another software package. Please see the documentation regarding Embedded Distribution for more information.

macOS users

  • For Python 3.8, we provide one installer: 64-bit-only that works on macOS 10.9 (Mavericks) and later systems.
  • Please read the «Important Information» displayed during installation for information about SSL/TLS certificate validation and the running the «Install Certificates.command».

And now for something completely different

(Cut to BBC world symbol.)
Continuity Voice: (Eric Idle) Now on BBC television a choice of viewing. On BBC 2 — a discussion on censorship between Derek Hart, The Bishop of Woolwich, and a nude man. And on BBC 1 — me telling you this. And now.
(Sound of TV set bring switched off. The picture reduces to a spot and we see it was actually on a TV set which has just been switched off by the housewife. The inspector holds a cup with a cherry on a stick in it.)
She: (Terry Jones) We don’t want that, do we. Do you really want that cherry in your tea? Do you like doing this job?
Inspector: (Michael Palin) Well, it’s a living, isn’t it?

Downloading Files using Python (Simple Examples)

In this tutorial, you will learn how to download files from the web using different Python modules. You will download regular files, web pages, Amazon S3, and other sources.

Also, you will learn how to overcome many challenges that you may counter, such as downloading files that redirect, downloading large files, multithreaded download, and other tactics.

Table of Contents

Using requests

You can download files from a URL using the requests module.

Consider the code below:

Simply, get the URL using the get method of requests module and store the result into a variable “myfile” variable. Then you write the contents of the variable into a file.

Using wget

You can also download a file from a URL by using the wget module of Python. Install the wget module using pip as follows:

Consider the following code in which we will download the logo image of Python:

In this code, we passed the URL along with the path (where we will store the image) to the download method of the wget module.

Download file that redirects

In this section, you will learn to download from a URL that redirects to another URL with a .pdf file using requests. The URL is like the following:

To download this pdf file, use the following code:

Читайте также:  Как восстановить windows со всеми данными

In this code, the first step we specify the URL. Then we use the get method of the requests module to fetch the URL. In the get method, we set the allow_redirects to True, which will allow redirection in the URL. After redirection, the content will be in myfile variable.

Finally, we open a file to write the fetched content.

Download large file in chunks

Consider the code blew:

First, we use the get method of the requests module as we did before, but this time we will set the stream attribute to True.

Then we create a file named PythonBook.pdf in the current working directory and open it for writing.

Then we specify the chunk size that we want to download at a time. We have set to 1024 bytes. Iterate through each chunk and write the chunks in the file until the chunks finished.

The Python shell will look like the following when the chunks are downloading:

Not pretty? Don’t worry; we will show a progress bar for the downloading process later.

Download multiple files (Parallel/bulk download)

To download multiple files at a time, import the following modules:

We imported the os and time modules to check how much time it takes to download files. The module ThreadPool lets you run multiple threads or processes using the pool.

Let’s create a simple function which sends the response to a file in chunks:

The URLs variable is a two-dimensional array that specifies the path and the URL of a page you want to download.

Pass the URL to requests.get as we did in the previous section. Finally, open the file (path specified in the URL) and write the content of the page.

Now we can call this function for each URL separately, and we can also call this function for all the URLs at the same time. Let’s do it for each URL separately in for loop and notice the timer:

The result will be like this:

Now replace the for loop with the following line of code:

Download with a progress bar

The Progress bar is a UI widget of the clint module. To install the clint module, type the following command:

Consider the following code:

In this code, we imported the requests module and then from clint.textui, we imported the progress widget. The only difference is in the for loop. We used the bar method of the progress module while writing the content into the file. The output will be like the following:

Download a webpage using urllib

In this section, we will be downloading a webpage using the urllib.

The urllib library is a standard library of Python, so you do not need to install it.

The following line of code can easily download a webpage:

Specify the URL here that you want to save as and where you want to store it:

In this code, we used the urlretrieve method and passed the URL of a file along with the path where we will save the file. The file extension will be .html.

Download via proxy

If you need to use a proxy to download your files, you can use the ProxyHandler of the urllib module. Check the following code:

In this code, we created the proxy object and opened the proxy by invoking the build_opener method of urllib and passed the proxy object. Then we made the request to retrieve the page.

Also, you can use the requests module as documented in the official documentation:

Simply import the requests module and create your proxy object. Then you can retrieve the file.

Using urllib3

The urllib3 is an improved version of the urllib module. You can download and install it using pip:

We will fetch a web page and store it in a text file by using urllib3.

Import the following modules:

You can use the shutil module when working with files. Now initialize the URL string variable like this:

Then we use the PoolManager of urllib3 that keeps track of necessary connection pools.

Finally, we send a GET request to fetch the URL and open a file and write the response into that file:

Download file from S3 using boto3

To download files from Amazon S3, you can use the Python boto3 module.

First, you need to install the awscli module using pip:

For AWS configuration, run the following command:

Now enter your details as:

To download a file from Amazon S3, import boto3, and botocore. Boto3 is an Amazon SDK for Python to access Amazon web services such as S3. Botocore provides the command line services to interact with Amazon web services.

Botocore comes with awscli. To install boto3 run the following:

Now import these two modules:

When downloading files from Amazon, we need three parameters:

  1. The name of Bucket
  2. The name of the file you need to download
  3. The name of the file after it has downloaded

Initialize the variables:

Now initialize a variable to use the resource of a session. For this, we will call the resource() method of boto3 and pass the service which is s3:

Finally, download the file by using the download_file method and pass in the variables:

Using asyncio

You can use the asyncio module to handle system events. It works around an event loop that waits for an event to occur and then reacts to that event. The reaction can be calling another function. This process is called event handling. The asyncio module uses coroutines for event handling.

Читайте также:  Microsoft windows 10 professional 64 bit russian dsp oei dvd оем

To use the asyncio event handling and coroutine functionality, we will import the asyncio module:

Also, we need to install aiohttp module.

We will import the async_timeout module to handle timeouts.

The keyword async tells that this is a native asyncio coroutine. Inside the body of the coroutine, we have the await keyword, which returns a certain value. We also used the return keyword.

Now let’s create a code using a coroutine to download files from the web:

In this code, we created an async coroutine function that downloads our files in chunks and saves them with a random file name and returns a message.

Then we have another async coroutine calls the get_url and waits for the URLs and make a queue of all URLs.

Now to start the coroutine, we have to put the coroutine inside the event loop by using the get_event_loop() method of asyncio and finally, the event loop is executed using the run_until_complete() method of asyncio.

Downloading files using Python is fun. I hope you find the tutorial useful.

Download the latest source release

Download the latest version of Python

Looking for Python with a different OS? Python for Windows, Linux/UNIX, Mac OS X, Other

Want to help test development versions of Python? Prereleases, Docker images

Looking for Python 2.7? See below for specific releases

Active Python Releases

  1. 3.9 bugfix 2020-10-05 2025-10 PEP 596
  2. 3.8 bugfix 2019-10-14 2024-10 PEP 569
  3. 3.7 security 2018-06-27 2023-06-27 PEP 537
  4. 3.6 security 2016-12-23 2021-12-23 PEP 494
  5. 2.7 end-of-life 2010-07-03 2020-01-01 PEP 373

Looking for a specific release?

Python releases by version number:

  1. Python 3.9.4 April 4, 2021 DownloadRelease Notes
  2. Python 3.8.9 April 2, 2021 DownloadRelease Notes
  3. Python 3.9.2 Feb. 19, 2021 DownloadRelease Notes
  4. Python 3.8.8 Feb. 19, 2021 DownloadRelease Notes
  5. Python 3.6.13 Feb. 15, 2021 DownloadRelease Notes
  6. Python 3.7.10 Feb. 15, 2021 DownloadRelease Notes
  7. Python 3.8.7 Dec. 21, 2020 DownloadRelease Notes
  8. Python 3.9.1 Dec. 7, 2020 DownloadRelease Notes
  9. Python 3.9.0 Oct. 5, 2020 DownloadRelease Notes
  10. Python 3.8.6 Sept. 24, 2020 DownloadRelease Notes
  11. Python 3.5.10 Sept. 5, 2020 DownloadRelease Notes
  12. Python 3.7.9 Aug. 17, 2020 DownloadRelease Notes
  13. Python 3.6.12 Aug. 17, 2020 DownloadRelease Notes
  14. Python 3.8.5 July 20, 2020 DownloadRelease Notes
  15. Python 3.8.4 July 13, 2020 DownloadRelease Notes
  16. Python 3.7.8 June 27, 2020 DownloadRelease Notes
  17. Python 3.6.11 June 27, 2020 DownloadRelease Notes
  18. Python 3.8.3 May 13, 2020 DownloadRelease Notes
  19. Python 2.7.18 April 20, 2020 DownloadRelease Notes
  20. Python 3.7.7 March 10, 2020 DownloadRelease Notes
  21. Python 3.8.2 Feb. 24, 2020 DownloadRelease Notes
  22. Python 3.8.1 Dec. 18, 2019 DownloadRelease Notes
  23. Python 3.7.6 Dec. 18, 2019 DownloadRelease Notes
  24. Python 3.6.10 Dec. 18, 2019 DownloadRelease Notes
  25. Python 3.5.9 Nov. 2, 2019 DownloadRelease Notes
  26. Python 3.5.8 Oct. 29, 2019 DownloadRelease Notes
  27. Python 2.7.17 Oct. 19, 2019 DownloadRelease Notes
  28. Python 3.7.5 Oct. 15, 2019 DownloadRelease Notes
  29. Python 3.8.0 Oct. 14, 2019 DownloadRelease Notes
  30. Python 3.7.4 July 8, 2019 DownloadRelease Notes
  31. Python 3.6.9 July 2, 2019 DownloadRelease Notes
  32. Python 3.7.3 March 25, 2019 DownloadRelease Notes
  33. Python 3.4.10 March 18, 2019 DownloadRelease Notes
  34. Python 3.5.7 March 18, 2019 DownloadRelease Notes
  35. Python 2.7.16 March 4, 2019 DownloadRelease Notes
  36. Python 3.7.2 Dec. 24, 2018 DownloadRelease Notes
  37. Python 3.6.8 Dec. 24, 2018 DownloadRelease Notes
  38. Python 3.7.1 Oct. 20, 2018 DownloadRelease Notes
  39. Python 3.6.7 Oct. 20, 2018 DownloadRelease Notes
  40. Python 3.5.6 Aug. 2, 2018 DownloadRelease Notes
  41. Python 3.4.9 Aug. 2, 2018 DownloadRelease Notes
  42. Python 3.7.0 June 27, 2018 DownloadRelease Notes
  43. Python 3.6.6 June 27, 2018 DownloadRelease Notes
  44. Python 2.7.15 May 1, 2018 DownloadRelease Notes
  45. Python 3.6.5 March 28, 2018 DownloadRelease Notes
  46. Python 3.4.8 Feb. 5, 2018 DownloadRelease Notes
  47. Python 3.5.5 Feb. 5, 2018 DownloadRelease Notes
  48. Python 3.6.4 Dec. 19, 2017 DownloadRelease Notes
  49. Python 3.6.3 Oct. 3, 2017 DownloadRelease Notes
  50. Python 3.3.7 Sept. 19, 2017 DownloadRelease Notes
  51. Python 2.7.14 Sept. 16, 2017 DownloadRelease Notes
  52. Python 3.4.7 Aug. 9, 2017 DownloadRelease Notes
  53. Python 3.5.4 Aug. 8, 2017 DownloadRelease Notes
  54. Python 3.6.2 July 17, 2017 DownloadRelease Notes
  55. Python 3.6.1 March 21, 2017 DownloadRelease Notes
  56. Python 3.4.6 Jan. 17, 2017 DownloadRelease Notes
  57. Python 3.5.3 Jan. 17, 2017 DownloadRelease Notes
  58. Python 3.6.0 Dec. 23, 2016 DownloadRelease Notes
  59. Python 2.7.13 Dec. 17, 2016 DownloadRelease Notes
  60. Python 3.4.5 June 27, 2016 DownloadRelease Notes
  61. Python 3.5.2 June 27, 2016 DownloadRelease Notes
  62. Python 2.7.12 June 25, 2016 DownloadRelease Notes
  63. Python 3.4.4 Dec. 21, 2015 DownloadRelease Notes
  64. Python 3.5.1 Dec. 7, 2015 DownloadRelease Notes
  65. Python 2.7.11 Dec. 5, 2015 DownloadRelease Notes
  66. Python 3.5.0 Sept. 13, 2015 DownloadRelease Notes
  67. Python 2.7.10 May 23, 2015 DownloadRelease Notes
  68. Python 3.4.3 Feb. 25, 2015 DownloadRelease Notes
  69. Python 2.7.9 Dec. 10, 2014 DownloadRelease Notes
  70. Python 3.4.2 Oct. 13, 2014 DownloadRelease Notes
  71. Python 3.3.6 Oct. 12, 2014 DownloadRelease Notes
  72. Python 3.2.6 Oct. 12, 2014 DownloadRelease Notes
  73. Python 2.7.8 July 2, 2014 DownloadRelease Notes
  74. Python 2.7.7 June 1, 2014 DownloadRelease Notes
  75. Python 3.4.1 May 19, 2014 DownloadRelease Notes
  76. Python 3.4.0 March 17, 2014 DownloadRelease Notes
  77. Python 3.3.5 March 9, 2014 DownloadRelease Notes
  78. Python 3.3.4 Feb. 9, 2014 DownloadRelease Notes
  79. Python 3.3.3 Nov. 17, 2013 DownloadRelease Notes
  80. Python 2.7.6 Nov. 10, 2013 DownloadRelease Notes
  81. Python 2.6.9 Oct. 29, 2013 DownloadRelease Notes
  82. Python 3.2.5 May 15, 2013 DownloadRelease Notes
  83. Python 3.3.2 May 15, 2013 DownloadRelease Notes
  84. Python 2.7.5 May 12, 2013 DownloadRelease Notes
  85. Python 2.7.4 April 6, 2013 DownloadRelease Notes
  86. Python 3.2.4 April 6, 2013 DownloadRelease Notes
  87. Python 3.3.1 April 6, 2013 DownloadRelease Notes
  88. Python 3.3.0 Sept. 29, 2012 DownloadRelease Notes
  89. Python 3.2.3 April 10, 2012 DownloadRelease Notes
  90. Python 2.6.8 April 10, 2012 DownloadRelease Notes
  91. Python 2.7.3 April 9, 2012 DownloadRelease Notes
  92. Python 3.1.5 April 9, 2012 DownloadRelease Notes
  93. Python 3.2.2 Sept. 3, 2011 DownloadRelease Notes
  94. Python 3.2.1 July 9, 2011 DownloadRelease Notes
  95. Python 2.7.2 June 11, 2011 DownloadRelease Notes
  96. Python 3.1.4 June 11, 2011 DownloadRelease Notes
  97. Python 2.6.7 June 3, 2011 DownloadRelease Notes
  98. Python 2.5.6 May 26, 2011 DownloadRelease Notes
  99. Python 3.2.0 Feb. 20, 2011 DownloadRelease Notes
  100. Python 2.7.1 Nov. 27, 2010 DownloadRelease Notes
  101. Python 3.1.3 Nov. 27, 2010 DownloadRelease Notes
  102. Python 2.6.6 Aug. 24, 2010 DownloadRelease Notes
  103. Python 2.7.0 July 3, 2010 DownloadRelease Notes
  104. Python 3.1.2 March 20, 2010 DownloadRelease Notes
  105. Python 2.6.5 March 18, 2010 DownloadRelease Notes
  106. Python 2.5.5 Jan. 31, 2010 DownloadRelease Notes
  107. Python 2.6.4 Oct. 26, 2009 DownloadRelease Notes
  108. Python 2.6.3 Oct. 2, 2009 DownloadRelease Notes
  109. Python 3.1.1 Aug. 17, 2009 DownloadRelease Notes
  110. Python 3.1.0 June 26, 2009 DownloadRelease Notes
  111. Python 2.6.2 April 14, 2009 DownloadRelease Notes
  112. Python 3.0.1 Feb. 13, 2009 DownloadRelease Notes
  113. Python 2.5.4 Dec. 23, 2008 DownloadRelease Notes
  114. Python 2.5.3 Dec. 19, 2008 DownloadRelease Notes
  115. Python 2.4.6 Dec. 19, 2008 DownloadRelease Notes
  116. Python 2.6.1 Dec. 4, 2008 DownloadRelease Notes
  117. Python 3.0.0 Dec. 3, 2008 DownloadRelease Notes
  118. Python 2.6.0 Oct. 2, 2008 DownloadRelease Notes
  119. Python 2.4.5 March 11, 2008 DownloadRelease Notes
  120. Python 2.3.7 March 11, 2008 DownloadRelease Notes
  121. Python 2.5.2 Feb. 21, 2008 DownloadRelease Notes
  122. Python 2.5.1 April 19, 2007 DownloadRelease Notes
  123. Python 2.3.6 Nov. 1, 2006 DownloadRelease Notes
  124. Python 2.4.4 Oct. 18, 2006 DownloadRelease Notes
  125. Python 2.5.0 Sept. 19, 2006 DownloadRelease Notes
  126. Python 2.4.3 April 15, 2006 DownloadRelease Notes
  127. Python 2.4.2 Sept. 27, 2005 DownloadRelease Notes
  128. Python 2.4.1 March 30, 2005 DownloadRelease Notes
  129. Python 2.3.5 Feb. 8, 2005 DownloadRelease Notes
  130. Python 2.4.0 Nov. 30, 2004 DownloadRelease Notes
  131. Python 2.3.4 May 27, 2004 DownloadRelease Notes
  132. Python 2.3.3 Dec. 19, 2003 DownloadRelease Notes
  133. Python 2.3.2 Oct. 3, 2003 DownloadRelease Notes
  134. Python 2.3.1 Sept. 23, 2003 DownloadRelease Notes
  135. Python 2.3.0 July 29, 2003 DownloadRelease Notes
  136. Python 2.2.3 May 30, 2003 DownloadRelease Notes
  137. Python 2.2.2 Oct. 14, 2002 DownloadRelease Notes
  138. Python 2.2.1 April 10, 2002 DownloadRelease Notes
  139. Python 2.1.3 April 9, 2002 DownloadRelease Notes
  140. Python 2.2.0 Dec. 21, 2001 DownloadRelease Notes
  141. Python 2.0.1 June 22, 2001 DownloadRelease Notes
Читайте также:  Скрипты для консоли windows

Sponsors

Visionary sponsors like Google help to host Python downloads.

Licenses

All Python releases are Open Source. Historically, most, but not all, Python releases have also been GPL-compatible. The Licenses page details GPL-compatibility and Terms and Conditions.

Sources

For most Unix systems, you must download and compile the source code. The same source code archive can also be used to build the Windows and Mac versions, and is the starting point for ports to all other platforms.

Download the latest Python 3 and Python 2 source.

Alternative Implementations

This site hosts the «traditional» implementation of Python (nicknamed CPython). A number of alternative implementations are available as well.

History

Python was created in the early 1990s by Guido van Rossum at Stichting Mathematisch Centrum in the Netherlands as a successor of a language called ABC. Guido remains Python’s principal author, although it includes many contributions from others.

Release Schedules

Information about specific ports, and developer info

OpenPGP Public Keys

Source and binary executables are signed by the release manager or binary builder using their OpenPGP key. Release files for currently supported releases are signed by the following:

Release files for older releases which have now reached end-of-life may have been signed by one of the following:

  • Anthony Baxter (key id: 0EDD C5F2 6A45 C816)
  • Georg Brandl (key id: 0A5B 1018 3658 0288)
  • Martin v. Löwis (key id: 6AF0 53F0 7D9D C8D2)
  • Ronald Oussoren (key id: C9BE 28DE E6DF 025C)
  • Barry Warsaw (key ids: 126E B563 A74B 06BF, D986 6941 EA5B BD71, and ED9D77D5)

You can import a person’s public keys from a public keyserver network server you trust by running a command like:

or, in many cases, public keys can also be found at keybase.io. On the version-specific download pages, you should see a link to both the downloadable file and a detached signature file. To verify the authenticity of the download, grab both files and then run this command:

Note that you must use the name of the signature file, and you should use the one that’s appropriate to the download you’re verifying.

  • (These instructions are geared to GnuPG and Unix command-line users.)

Other Useful Items

  • Looking for 3rd party Python modules? The Package Index has many of them.
  • You can view the standard documentation online, or you can download it in HTML, PostScript, PDF and other formats. See the main Documentation page.
  • Information on tools for unpacking archive files provided on python.org is available.
  • Tip: even if you download a ready-made binary for your platform, it makes sense to also download the source. This lets you browse the standard library (the subdirectory Lib) and the standard collections of demos (Demo) and tools (Tools) that come with it. There’s a lot you can learn from the source!
  • There is also a collection of Emacs packages that the Emacsing Pythoneer might find useful. This includes major modes for editing Python, C, C++, Java, etc., Python debugger interfaces and more. Most packages are compatible with Emacs and XEmacs.

Want to contribute?

Want to contribute? See the Python Developer’s Guide to learn about how Python development is managed.

Оцените статью