How downgrade python version
How downgrade python version
How do I downgrade my version of python from 3.7.5 to 3.6.5 on ubuntu
So currently, I have ubuntu 19. And it comes by default with python 3.7.5. I need to downgrade to 3.6.5.
I am using virtualenv
3 Answers 3
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
The following talks about upgrade from 3.6.7 to 3.7.0 but you can use the same process for downgrade. You should not change the system python unless you really know what you’re doing
First Install Pyenv
Look at Pyenv Options
Look at Python Versions
Install a new Python
If you run into an issue with _ctypes install libffi-dev library
Now look at the versions
Select 3.7.0 for local environment
See that the version changed
Switch to a different folder
The python version may be different here depending on which python version you have set locally
Set pyenv version globally
This globally sets a python version for a user
Note that pyenv knows the global version by looking at the
Install it from the pre-compiled Ubuntu deb package repos.
When prompted, pres ENTER to continue.
You can also use virtualenv to use different Python environments.
If you type python and tab twice or so, you might see a number of Python versions available. I say this because when I type
available. My alias for python is 3.7.5
Downgrade Python 3.9 to 3.8
You can use three effective methods to downgrade the version of Python installed on your device: the virtualenv method, the Control Panel method, and the Anaconda method. Here in our tutorial, we’ll provide you with the details and sample codes you need to downgrade your Python version.
Downgrade Python 3.9 to 3.8 With the virtualenv Module
The virtualenv method is used to create and manage different virtual environments for Python on a device; this helps resolve dependency issues, version issues, and permission issues among various projects.
Suppose we are dealing with a project that requires a different version of Python to run. In that case, we can use the virtualenv module to create a new virtual environment for that specific project and install the required version of Python inside that virtual environment. To create a virtual environment, we first have to install the vritualenv module. Here’s the command to install this module:
Now, we can create our virtual environment using the virtualenv module. The command to create a new virtual environment is given below.
Here, \path\to\env is the path of the virtual environment, and \path\to\python_install.exe is the path where the required version of Python is already installed. For this command to work, we have to install the required version of Python on our device first.
Please enable JavaScript
Upon installation, you just have to activate our virtual environment. You can do so by executing the command below:
Here, \path\to\env is the path of the virtual environment.
Downgrade Python 3.9 to 3.8 With Anaconda
This command creates a new virtual environment called downgrade for our project with Python 3.8. The next step is activating our virtual environment. The command to start a virtual environment using conda is given below.
The command above activates the downgrade virtual environment. Now, we can install all the packages required for our special project.
This approach is very similar to the virtualenv method. However, the conda method is simpler and easier to use than the previous approach. We don’t even need to install another Python version manually; the conda package manager automatically installs it for us.
Downgrade Python 3.9 to 3.8 With the Control Panel
This method only works for devices running the Windows Operating System. This approach involves manually uninstalling the previously existing Python version and then reinstalling the required version.
Now that the previous version of Python is uninstalled from your device, you can install your desired software version by going to the official Python download page.
This approach is the least preferred one among the ones discussed in this tutorial. It’s because this approach only works for Windows and should only be used when we don’t need the previous version of Python anymore.
The best approach for downgrading Python or using a different Python version, aside from the one already installed on your device, is using Anaconda. The commands for using Anaconda are very simple, and it automates most of the processes for us.
Downgrade Python Version
Python is maintained and updated regularly. Some new features are added on every update, and some old ones may get deprecated.
Some updates are major, while others might include minor changes. The code written in a specific Python version may or may not be compatible with other versions (the main example being the difference between Python 2 and Python 3).
This tutorial will demonstrate how to downgrade Python according to our needs on different devices. We will discuss methods for Windows, Linux, and Mac devices.
Downgrade Python Version on Windows
Reinstall to Downgrade Python on Windows
The first few methods involve uninstalling the current version of Python and installing the required version. There are several ways to achieve this.
Please enable JavaScript
The first method involves uninstalling the current Python version from the Control Panel. We can search for the Add or Remove Programs application in the Control Panel.
This application contains a list of all the programs installed on the device. We can select the installed version of Python from this list, right-click to select the uninstall option, and follow the steps.
Another way to uninstall the installed version of Python is by using the Python package installer used earlier to install Python. We get the repair and uninstall options on running the Python package installer.
We can click on the uninstall option and proceed with the required steps.
After using any of the previous methods, it is necessary to delete the Python files available in the directory of the same name (usually found in the C:\Program Files directory). It is also necessary to make sure that the path from the environment variable is removed.
After carrying out the uninstallation of Python, we can install the required version and download its package installer application from the official website of Python.
Use a Virtual Environment to Downgrade Python on Windows
Python allows us to create different virtual environments. Each virtual environment can have its required version of Python interpreter and packages.
To create a virtual environment, we can use the command pip install virtualenv on the command prompt. We need to download the required version from the official website.
Use Anaconda Prompt to Downgrade Python on Windows
This method is limited to the users of Anaconda Navigator. On the Anaconda prompt, we can install the required version of Python and overwrite the previous version using the conda install python= version command.
It is necessary to check if this version is available or not by running the conda search python command and checking for the available versions.
Downgrade Python Version on Linux
Reinstall to Downgrade Python on Linux
We can remove and install the required version of Python to downgrade it. First, we need to download the package from the official website and install it.
Use Pyenv to Downgrade Python on Linux
Pyenv allows us to switch between different versions of Python by creating environments.
We can install the required version of Python using the pyenv install python_version command on the terminal. After that, we can view the available versions using the pyenv versions command.
To set the required version as the Python version for the local environment, we can use the pyenv local python_version command.
Next, we can switch to a different folder and set the required Python version globally. To set the version globally for a user, we use the pyenv global python_version command.
Use Homebrew to Downgrade Python on Linux
Homebrew is an application manager that can manage and install open-source applications. It is available on macOS and Linux.
We can clone to the repository of our required version of Python and unlink the previous version using a set of simple commands. These are shown below.
Use Anaconda to downgrade Python on Linux
Anaconda is also available on macOS and Linux devices. We can follow the steps discussed in the previous section of Downgrade Python on Windows and use them for these devices.
Downgrade Python Version on macOS
On macOS, we can use the methods involving Pyenv, Homebrew, and Anaconda discussed in the previous section. These methods are valid here as well.
how can I downgrade from python 3.7 to 3.6 in windows
I’m trying to install tensorflow but python 3.7 does not support that, so I want to get python 3.6 instead without using anaconda.
3 Answers 3
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
I have done this multiple times.
My first tip is use virtual environments. That way you can use python 3.6 for what ever project requires that version of python, and python 3.7 for other projects that need that version.
However on windows these are the best steps:
1.) Uninstall python 3.7 from your computer using command prompt
2.) Double check in your program files folder to see if there are any lingering python 3.7 folders you need to delete. Do not delete any site-packages folders or you will need to reinstall the packages you have deleted.
3.) Go to https://www.python.org/downloads/ and download and install python 3.6 and make sure you add it to your path when installing
But I suggest starting to use Virtual Environments to avoid this issue or downloading different python versions based on specific library needs.
UPDATE
Regarding the point of not deleting site-packages folders. Some of your packages may not be compatible with lower versions of python. This may not be a huge issue for some people, but it is best to check your most commonly used packages to see their compatible python versions before continuing with the downgrade
How to downgrade python from 3.7 to 3.6
I’m trying to install tensorflow but it needs a Python 3.6 installation and I only have Python 3.7 installed. I tried to switch using brew and pyenv but it doesn’t work.
Does anyone know of a way to solve this problem?
15 Answers 15
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
Here is a canonical summary which sums up different solutions for the variety of operating system Python runs on. What follows are possibilities for Microsoft Windows, Linux, macOS and Misc.
Microsoft Windows
Option 1
In general, it’s suggested to use virtual environments (I highly suggest looking at the official Python documentation). With this approach, you easily can set up project-specific Python versions (as well as libraries). Easily manageable and the best part: There are lots of tutorials on the internet on how to approach this:
Option 2
Option 3
Option 4
Choose whether to register Anaconda as your default Python. Unless you plan on installing and running multiple versions of Anaconda or multiple versions of Python, accept the default and leave this box checked.
Follow the official tutorial I linked above.
Option 5
Linux
Option 1
Option 2
Option 3
Option 5
Option 6
What a goldmine this thread is! As @nondetermistic has described in-depth (direct link to his post):
Install Python source code as it is like this:
macOS
Option 1
1.) Installing pyenv with Homebrew :
2.) Cloning the GitHub repository to get latest pyenv version:
3.) Defining the environment variables as follows
4.) Restarting shell so PATH change works
5.) Checking the available Python versions
6.) Installing the wanted Python version, e.g. 3.6
7.) Setting it globally (you can also go ahead and only use it in a certain environment)
Option 2
Similar to previous approaches you can download Anaconda on macOS as well. For an installation guide click here. The usage is pretty much the same as I’ve already described in Option 4 of the Windows guide. Please check out above.
Other options
In this case it’s getting pretty repetitive. I kindly suggest you to check the following resources for further reading:
Источники информации:
- http://www.delftstack.com/howto/python/downgrade-python/
- http://www.delftstack.com/howto/python/downgrade-python-version/
- http://stackoverflow.com/questions/54371847/how-can-i-downgrade-from-python-3-7-to-3-6-in-windows
- http://stackoverflow.com/questions/52584907/how-to-downgrade-python-from-3-7-to-3-6