Anaconda is a tool that every AI Engineer, Data Scientist, Data Analyst or Data Architect should try sometime in their life.
What is Anaconda?
Anaconda is an open-source software made up of packages and applications that help with data science and data analysis programming, although it can be used in a broad range of industries.
When a large project is being developed, is necessary to have control of the packages that have been installed because dependencies may appear that can spoil the whole project. To help solve these possible problems, anaconda is our friend with its environment management and packages installer.
Firstly, Anaconda allows you to install packages from its own packages installer, by the way, you can combine it with PIP installing packages from Python Package Index (PyPI). However, anaconda allows you to install packages written in C, R, Java and even build packages from source code (in the lasts PIP version this feature is incorporated although it is easier to get bugs because is for academic purpose)
Secondly, you will see later, it permits the creation of isolated environments with the packages and versions that are necessary, making a copy of the binary files in the Anaconda directory. In order to be able to carry out a similar control without Anaconda, it would be necessary to install "virtualenv" and its plugin "pyenv-virtualenvwrapper" however it is not possible to choose the packages that are wanted in the environment in advance.
Be an Anaconda Shaolin Monk easily!
conda create --name test_env python=3.8
This command generates a virtual Anaconda environment in the "envs" directory with the name written for the --name parameter and the python version. In this case test_env and python 3.8.
conda activate test_env (windows)
Activate the environment that has been created so that packages can be installed without affecting the others.
Allows you to deactivate the environment that you were using
conda create --clone test_env --name test_env_cloned
If the environment you have used is working well (for example in production), it is recommended to copy the environment and work on it so as not to affect the main environment.
conda env remove --name test_env
It allows you to delete environments that are no longer used in order to have a cleaner and better management of environments.
However, the environments created with the previous commands generate empty or default environments. For this reason, with that command you can create an environment and at the same time add the packages that need to be used in the project:
conda create --name test_env scikit-learn
If you have created an environment and you wish to install a package, it can be installed in two different ways:
conda install jupyter
pip install jupyter
In addition, for people who do not like using the terminal, all commands can be executed using the Anaconda graphic interface.
Anaconda has many more commands to manage environments, packages end even Python version control. However, these are not the indispensable commands to know the power of Anaconda. In addition, Anaconda has a suite of applications so Anaconda (not mini-Anaconda) has different tools for programming in a more comfortable and fast way, however, this is going to be seen in future posts
In conclusion, anaconda is the perfect free software to carry out projects that offer higher quality and faster results due to its easy management of virtual environments and packages. I like to call it the Swiss Army Knife of the Data Scientist.