A Comprehensive Guide to Upgrading Python Using Conda

Upgrade Your Python Using Anaconda

The anaconda distribution is an effective tool for carrying out complex scientific computations related to analytics and data science in Python and R. It is free to use and open source. It is similar to a hub for various Python and R tools that one might need for their projects. There are also some priced plans available for businesses or working professionals. It has over more than 250 libraries that come pre-installed with it for you to get hands-on experience with data analytics tools and creating your very own machine learning algorithms.

With Anaconda, you can also use Jupyter Notebook to create and share your computations and scientific Python documents . You can create virtual environments and manage them via the anaconda prompt or navigator.

Besides, it also comes installed with datalore by JetBrains, for machine learning, data analytics and visualization. The availability of such high functioning modules make anaconda one of the most powerful data science tools in the world.

Anaconda, a powerful data science tool, comes with over 250 pre-installed libraries for Python and R. It allows you to manage virtual environments and comes with Jupyter Notebook for creating and sharing Python documents. This article guides you on how to upgrade Python using the Anaconda prompt or Conda environment

In this article we will see how to upgrade your Python to the latest version using the anaconda prompt or the conda environment.

Choosing Conda vs Pip: Which One Is Better?

When you install Anaconda in your local system, you will find that the file size during the download and installation process is way bigger than the normal Python installation. This is because when you install Python, only the essential packages required by Python are installed along with it. Packages such as Numpy, Matplotlib and Scipy are not installed in your system by default when you install Python. But when you download anaconda, all of these extremely essential modules are pre- installed.

One of the biggest advantages of using the Anaconda distribution is conflict resolution. Anaconda creates a virtual environment for each of your projects which reduces the amount of conflict that your projects may encounter at Run time. Even at the time of installation of a particular package, if conda senses future conflicts during imports, it gives you an error or a fair warning asking you to change or remove the necessary.

Unlike PIP, which may not warn about conflicting dependencies during installation but raise errors during imports, Conda alerts you to potential dependency conflicts at the outset and halts the installation process if it encounters an error.

The conda package installer will only work in your Anaconda prompt or your Linux terminal(if you’re using a Linux system), whereas PIP will work in your command prompt.

Besides using the conda installer, you can also install packages and upgrade your Python using the Anaconda Navigator which is a graphical user interface used for environment and package management.

Related: Python Anaconda Tutorial – Getting Started With Anaconda.

A Comprehensive Guide to Upgrading Python Using Conda

  • First and foremost, go to your search bar from the Taskbar at the very bottom of your screen.
  • Type, “anaconda prompt” and hit Enter or Run as administrator(This is advisable) depending on your choice.
  • Now type python --version to check the working version of Python in your system.
  • Now, search for your required Python version by running the following code.
conda search python
  • You’ll see a list of all the available Python versions.
  • Since we have already discussed that when using conda it is advisable to create separate environments to keep conflicts at bay.
  • We are going to install python 3.8.
  • Create a new environment by running the following code:
conda create -n py38 python=3.8 anaconda
  • Now we need to activate our environment for the libraries to properly load. Run the following code to activate your newly installed Python version:
conda activate py38
  • Now, if your environment is active, you will see the environment name in parenthesis in your anaconda prompt as shown below.
Activating Your Newly Created Environment In Conda
Activating Your Newly Created Environment In Conda
  • If you don’t, run the following command to verify your current environment.
conda info --envs
  • After activating your environment, you can check the installed packages in that particular environment by running:
conda list
  • To check whether your Python has been upgraded or changed to python 3.8 or any other version, Run the following command in your anaconda prompt.
python --version

The alternate to this is simply upgrading or changing the version of your python by running the code given below in your anaconda prompt. But this is not advisable because it becomes difficult for the system to identify the correct packages that should be upgraded or downgraded accordingly resulting in unwanted conflicts.

conda install python=3.8
conda update python

Similar: Activating a Virtual Environment in Windows 10 Command Prompt.

Conclusion: The Power of Anaconda and Conda for Python Development

In this article, we have seen how the anaconda distribution compares with the normal Python installation and how it already comes pre-installed with numerous tools to ease our tasks for science and computations. The Anaconda distribution is open source and free which enables users to create their applications at a reduced cost and comes in handy for both individuals and businesses. It is very easy to use different versions of Python for different projects using the conda installation process as it creates a virtual environment for each project. With the power of Anaconda and Conda at your fingertips, the possibilities for your next project are limitless. What groundbreaking application will you create next?