. Advertisement .
..3..
. Advertisement .
..4..
Anaconda is known as a Python and R open-source distribution for data science for the purpose of simplifying the process of managing and deploying packages. Anaconda package versions are managed through a management system called conda. Before conducting an installation, this system will analyze the present environment not to disrupt other packages and frameworks.
In this post, we would like to provide you guidance on how to change the version of Python in Anaconda. Scroll down for exploring efficient methods!
1. Use the Command conda install on the Prompt of Anaconda Command
The first method to change the version of Python in Anaconda is using the command conda install. This command agrees to receive a package specification list and set a package collection appropriate to that list and compatible with the environment. If the compatibility is not ensured, a fault will be reported and the environment will not be changed.
To change the version of Python, you can run the below command:
conda install python=<the_version>
Or you can try another example:
conda install python=3.5
Notably, the latest version installation of packages as required is put in the effort by conda. To execute this, some installed packages might be updated or additional packages might be installed. To avoid updating the current packages, use the option –freeze-installed.
2. Use the Command conda create on the Prompt of Anaconda Command
Alternatively, you can run the command conda create to change the version of Python in Anaconda. This command can be used for creating a new environment in conda from a specified package list. If you want to utilize the created environment, conda activate envname is a command to use for finding out the directory first. Besides that, there might be options required by this command including -n NAME or -p PREFIX.
To install a new Python version in a certain environment, you can follow the code example below.
conda create -n <my_environment> python=<new_version>
Or you can try alternative method:
conda create -n an_env python=3.5
Then, you need to use the following command for the environment activation.
conda activate <my_environment>
Also, you can follow the below way for issuing the command.
conda activate an_env
3. Use the Command conda update on the Prompt of Anaconda Command
The final method to change the version of Python in Anaconda that we want to introduce to you is using the command conda update. With this command, a package name list will be accepted and updated to the newest version that must have compatibility with other packages contained in the environment.
conda update python
The Bottom Line
Notably, the latest version installation of packages as required is put in the effort by conda. To execute this, some installed packages might be updated or additional packages might be installed. To avoid updating the current packages, use the option –no-update-deps. The above coding tutorials are all about how to change the version of Python in Anaconda. The usage of each command was explained in detail. Hence, we hope that you can understand the shared methods. If you want to learn more about other programming languages, click on any post on this website for deep knowledge!
Leave a comment