{"id":57216,"date":"2023-11-27T22:06:01","date_gmt":"2023-11-27T22:06:01","guid":{"rendered":"https:\/\/www.askpython.com\/?p=57216"},"modified":"2025-04-10T20:52:43","modified_gmt":"2025-04-10T20:52:43","slug":"downgrade-python-37-to-36","status":"publish","type":"post","link":"https:\/\/www.askpython.com\/python\/examples\/downgrade-python-37-to-36","title":{"rendered":"Downgrade From Python 3.7 to 3.6 on Windows, MacOS, and Linux"},"content":{"rendered":"\n<p>Python is an extremely popular programming language used for a wide variety of applications. As new versions of Python are released, they introduce useful features and improvements. However, sometimes, you may need to downgrade to an older Python version for compatibility reasons.<\/p>\n\n\n\n<p>Downgrading from Python 3.7 to 3.6 can be tricky but is entirely doable with the right approach. This comprehensive guide will cover several methods to downgrade Python on Windows, Linux, and Mac operating systems.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>Downgrading Python from version 3.7 to 3.6 involves a few critical steps. For Windows, you can either install an older Python version alongside the existing one or use the pyenv version manager. MacOS users can choose between pyenv and virtualenv, while Linux offers options like installing from source, pyenv, or virtualenv. Each method has its pros and cons, but ultimately allows for effective version management and environment isolation<\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Why Downgrade Python?<\/h2>\n\n\n\n<p>There are a few key reasons why you may need to downgrade from Python 3.7 to 3.6:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You rely on a library or framework that is not yet compatible with Python 3.7<\/li>\n\n\n\n<li>You need to replicate a production environment locally that runs on Python 3.6<\/li>\n\n\n\n<li>You are working with legacy codebases that require Python 3.6 to function properly<\/li>\n\n\n\n<li>You want to leverage specific features only present in Python 3.6<\/li>\n<\/ul>\n\n\n\n<p>For any of these reasons, switching between Python versions is very useful.<\/p>\n\n\n\n<p><strong><em>Also read: <a href=\"https:\/\/www.askpython.com\/python\/activating-virtual-environment-in-windows-10\" data-type=\"post\" data-id=\"48204\">Activating a Virtual Environment in Windows 10 Command Prompt<\/a><\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting Up for Python Downgrade<\/h2>\n\n\n\n<p>Before downgrading, it is highly recommended to create a virtual environment. Virtual environments allow you to encapsulate Python versions and package installations so they do not interfere with other projects.<\/p>\n\n\n\n<p><strong>Here is how to set up a virtual environment:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npython3 -m venv my_venv\nsource my_venv\/bin\/activate\n<\/pre><\/div>\n\n\n<p>This will create an isolated Python environment called <code>my_venv<\/code>. We can now install packages here without affecting the system Python installation.<\/p>\n\n\n\n<p><strong>Let&#8217;s first check our starting Python version:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npython --version\n# Python 3.7.4\n<\/pre><\/div>\n\n\n<p>We are currently on Python 3.7.4. Our goal is to downgrade to 3.6.<\/p>\n\n\n\n<p><strong><em>Also read: <a href=\"https:\/\/www.askpython.com\/python\/built-in-methods\/removing-duplicate-words-text\" data-type=\"post\" data-id=\"55908\">3 Approaches to Removing the Duplicate Words From a Text<\/a><\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps for Downgrading Python in Windows<\/h2>\n\n\n\n<p>There are a couple of good options for downgrading Python on Windows:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Install an Older Python Version<\/h3>\n\n\n\n<p>The simplest method is to install an older Python version separately alongside the existing installation.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Download the Python 3.6 installer for Windows from <a href=\"https:\/\/www.python.org\/downloads\/release\/python-368\/\" target=\"_blank\" rel=\"noopener\">python.org<\/a>.<\/li>\n\n\n\n<li>Run the installer, being sure to check &#8220;Add Python to PATH&#8221;:<\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Open a new terminal window and verify Python downgraded to 3.6:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npython --version\n# Python 3.6.8\n<\/pre><\/div>\n\n\n<p>We now have Python 3.6.8 available, isolated from the system Python 3.7. To switch back, close the terminal and reopen or run:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npath %PATH%;\npython --version # Python 3.7 again\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">2. Use pyenv Version Manager<\/h3>\n\n\n\n<p><a href=\"https:\/\/github.com\/pyenv\/pyenv\" target=\"_blank\" rel=\"noopener\">pyenv<\/a> is a useful tool for managing multiple Python versions.<\/p>\n\n\n\n<p><strong>To install on Windows:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# Install pyenv using pip\npip install pyenv-win \n\n# Set environment variables\npyenv init\n\n# reload shell\n<\/pre><\/div>\n\n\n<p><strong>Now we can install Python 3.6:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npyenv install 3.6.8\npyenv global 3.6.8\n<\/pre><\/div>\n\n\n<p><strong>Check Python downgraded:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npython --version\n# Python 3.6.8\n<\/pre><\/div>\n\n\n<p><strong>When done working with 3.6, switch versions with:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npyenv global 3.7.4\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Comparing Python Downgrade Techniques on Windows<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Method<\/th><th>Pros<\/th><th>Cons<\/th><\/tr><\/thead><tbody><tr><td>pyenv<\/td><td>Easily switch versions<\/td><td>Slower install<\/td><\/tr><tr><td>Virtualenv<\/td><td>Uses system Python<\/td><td>Need full path<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Downgrading Python on MacOS<\/h2>\n\n\n\n<p>The two best options for downgrading Python on Mac are pyenv and virtualenv.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. pyenv Method<\/h3>\n\n\n\n<p>As covered above, <a href=\"https:\/\/github.com\/pyenv\/pyenv\" target=\"_blank\" rel=\"noopener\">pyenv<\/a> is a great version manager for MacOS.<\/p>\n\n\n\n<p>Installation is simple using Homebrew:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nbrew update\nbrew install pyenv\n<\/pre><\/div>\n\n\n<p>Now install Python 3.6:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npyenv install 3.6.8\npyenv global 3.6.8 \npython --version\n# Python 3.6.8\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">2. Virtualenv Method<\/h3>\n\n\n\n<p>Virtualenv is included by default with Python installs.<\/p>\n\n\n\n<p>Create a Python 3.6 virtualenv:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nvirtualenv -p \/usr\/bin\/python3.6 my_venv\nsource my_venv\/bin\/activate\npython --version\n# Python 3.6.8  \n<\/pre><\/div>\n\n\n<p>This isolates Python 3.6 without needing to change global versions.<\/p>\n\n\n\n<p>Deactivate when done:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndeactivate\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Comparison of Mac Python Downgrade Methods<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Method<\/th><th>Pros<\/th><th>Cons<\/th><\/tr><\/thead><tbody><tr><td>pyenv<\/td><td>Easily switch versions<\/td><td>Slower install<\/td><\/tr><tr><td>Virtualenv<\/td><td>Uses system Python<\/td><td>Need full path<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Downgrading Python on Linux<\/h2>\n\n\n\n<p>Linux offers the most flexibility in downgrading Python versions. Here are some great options.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Install Older Python<\/h3>\n\n\n\n<p>Downloading and manually installing an older Python version is straightforward:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nwget https:\/\/www.python.org\/ftp\/python\/3.6.8\/Python-3.6.8.tgz\ntar xzf Python-3.6.8.tgz\ncd Python-3.6.8\n.\/configure --enable-optimizations\nmake -j 8 \nsudo make altinstall\n<\/pre><\/div>\n\n\n<p>This compiles Python 3.6.8 from source and installs it separately from the system Python.<\/p>\n\n\n\n<p>Now verify Python 3.6.8 is active:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npython --version\n# Python 3.6.8\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">2. Use pyenv<\/h3>\n\n\n\n<p>Our friend <a href=\"https:\/\/github.com\/pyenv\/pyenv\" target=\"_blank\" rel=\"noopener\">pyenv<\/a> also works great on Linux!<\/p>\n\n\n\n<p>Install pyenv and setup environment variables:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# Install pyenv \ncurl https:\/\/pyenv.run | bash\n\n# Add pyenv init to shell config\necho &#039;eval &quot;$(pyenv init -)&quot;&#039; &gt;&gt; ~\/.bashrc  \n\n# Reload shell\nexec &quot;$SHELL&quot;\n<\/pre><\/div>\n\n\n<p>Now install Python 3.6.8:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npyenv install 3.6.8\npyenv global 3.6.8\npython --version  \n# Python 3.6.8\n<\/pre><\/div>\n\n\n<p>When finished, change versions:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npyenv global 3.7  \n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">3. Use Virtualenv<\/h3>\n\n\n\n<p>As on other platforms, Python virtual environments are an excellent way to manage Python versions on Linux.<\/p>\n\n\n\n<p>Create a virtual environment called <code>my_venv<\/code> with Python 3.6:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\npython3.6 -m venv my_venv \nsource my_venv\/bin\/activate\npython --version\n# Python 3.6.8\n<\/pre><\/div>\n\n\n<p>Python is now isolated in <code>my_venv<\/code> without any system changes.<\/p>\n\n\n\n<p>Deactivate the environment when finished:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndeactivate \n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Comparison of Linux Python Downgrade Methods<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Method<\/th><th>Pros<\/th><th>Cons<\/th><\/tr><\/thead><tbody><tr><td>Install from Source<\/td><td>Simple, no dependencies<\/td><td>Manual process<\/td><\/tr><tr><td>pyenv<\/td><td>Powerful version manager<\/td><td>Complex setup<\/td><\/tr><tr><td>Virtualenv<\/td><td>Uses system Python<\/td><td>Env management<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Summary and Next Steps<\/h2>\n\n\n\n<p>We covered several effective methods to downgrade from Python 3.7 to 3.6 across Windows, MacOS, and Linux platforms. The choice depends on your needs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install older version<\/strong> &#8211; Quick and standalone<\/li>\n\n\n\n<li><strong>pyenv<\/strong> &#8211; Feature-rich version manager<\/li>\n\n\n\n<li><strong>Virtualenv<\/strong> &#8211; Environment isolation<\/li>\n<\/ul>\n\n\n\n<p>Downgrading Python can enable legacy application support, utilize vital libraries, and unlock access to key features of 3.6. With this guide, you should feel empowered to smoothly downgrade and switch between Python versions for your projects. As next steps, consider exploring Python virtualization using Docker containers if additional flexibility is needed in replicated production environments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python is an extremely popular programming language used for a wide variety of applications. As new versions of Python are released, they introduce useful features and improvements. However, sometimes, you may need to downgrade to an older Python version for compatibility reasons. Downgrading from Python 3.7 to 3.6 can be tricky but is entirely doable [&hellip;]<\/p>\n","protected":false},"author":77,"featured_media":64174,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-57216","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-examples"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/posts\/57216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/comments?post=57216"}],"version-history":[{"count":0,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/posts\/57216\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/media\/64174"}],"wp:attachment":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/media?parent=57216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/categories?post=57216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/tags?post=57216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}