Its all CONDA

Its all CONDA

A informational guide towards working with anaconda environments

Introduction:

If someone asks you, what is the most popular and efficient programming language today, you, and probably a major chunk of aspiring developers will answer the same. And the answer would be, PYTHON! Python is a versatile language that you can use on the back end, front end, or full stack of a web application. Well, it is no secret that with the enormous amounts of functionalities and libraries it provides, Python has become the go-to language for many developers across the world.

Now, one may wonder what is the best environment to work with python? Which IDE is the best and most efficient? The answer to these questions is simple. Anaconda. Now one may ask why is it so. Let's get the answer in the sections ahead.

What is Anaconda?

As mentioned above, Python is a versatile language that you can use on the back end, front end, or full stack of a web application. While the standard Python library has a lot of functionality, there are many times when we need modules and libraries that are not part of the standard library. That's where Anaconda comes in.

Anaconda Python is a free, open-source platform that allows you to write and execute code in the programming language Python. It is by continuum.io, a company that specializes in Python development. The Anaconda platform is the most popular way to learn and use Python for scientific computing, data science, and machine learning. It is used by over thirty million people worldwide and is available for Windows, macOS, and Linux.

Why Anaconda?

The question still persists, why is anaconda preferable and more efficient than every other IDE present? It is because Anaconda Python simplifies package deployment and management. It also comes with a large number of libraries/packages that you can use for your projects. Since Anaconda Python is free and open-source, anyone can contribute to its development.

Anaconda comes with many tools, the most important of which is 'conda'. conda is an environment manager provided by anaconda which helps the user to create, activate and deactivate multiple environments as per requirements. An environment is a collection of all the required modules, libraries and executable .py files combined together. The greatest advantage of conda is that developers can work on various versions of the same library or for that matter, even multiple python versions on the same machine at the same time, thanks to conda package manager.

My Experience:

I was recently working on a healthcare chatbot project, which was to be made in Python using the chatterbot library. It also included rendering using flask and database using SQLite, for which the sqlalchemy module was used. Initially, the project did not run, and I thought maybe it was coming across some exceptions in the code, but that was not the case. Later I found out that there were conflicting dependencies between my installed packages and I needed to install compatible versions of them, and also Python 3.11 was not supported. That's when the power of conda came to my help, and speaking the truth, I still had to create more than 5 environments before the project actually worked.

Creating an Environment with conda

Working with conda is extremely simple. You need to install anaconda and then open Anaconda prompt from the search menu.

Once the terminal opens, you have to type in the following command:

conda create --name Name

On clicking enter, the creation will start and after some time, conda will ask you to proceed further by clicking (y/n). Clicking Y will create the environment.

Behold! Your environment is created.

Working with Environments.

Once an environment is created, one only need to activate it, and then open the working directory in that environment. Command for activating the environment is:

conda activate NAME

We can see that our environment has been activated. Now, we can go to our directory using the cd command and start working on our project!

Conclusion:

In this blog, we learned how to use anaconda and conda environment manager for more efficient way of coding in python. There are many other functionalities of conda, which helps making coding in python easier. We will explore them in a later article. Until then, Keep coding!

Follow me: Twitter | LinkedIn | GitHub