Miniconda — Django Installation for dummies

There was a time when managing dependencies and requirements for our python project feels bothersome. Let’s take an example , at certain project, let’s name it , “project A”. You might need library A version 1. Later on, you start another project, let’s call it “project B” with library A version 2, because we need to use a certain new features which is only available on version 2.
Due to something which is not in our control, we cannot simply replace our library A version 1, because it is already used in our first project, live in production, and using version 2 would break our first project.
As the time goes, you or your company begin to add more people. That person code in a different environment, how can we make sure, that they can smoothly aid in the development of our project without breaking things.
what can we do to prevent any annoying situation from happening.
*drumroll * Conda came to the rescue.
According to its site
“Conda is an open source package management system and environment management system … ”
By this definition only, we can conclude, that we can use this Conda to create a different environment for every project that have a specific needs of library. If somehow , we give it to other people, We can ensure that it is going to run smooth exactly as we intended to be. So, how are we gonna do that.
First , open up https://conda.io/en/latest/miniconda.html , choose the version that suit your needs. Download and install. As for me, i install the mac version of miniconda , because it is more lightweight , and i am just going to install a package, required by my app.
Once you’ve done, run your terminal application, we will start creating environment which run a specific python version 3.7
$ conda create -n myfirstenv python=3.7
above command will create a conda environment , named myfirstenv , which has a python 3.7 as its core.
Next, we are going to activate that environment and start installing our required packages inside . Something that you can notice if you succeed in activating, you will find your environment name in the leftmost part of your current terminal prompt, just like this
$ conda activate myfirstenv
In this article we’re gonna try installing Django , a super useful web framework :
(myfirstenv) $ conda install -c anaconda django
there will be a confirmation prompts and logs indicating that it is doing the installation. Once it is finished , you can test it by this command
(myfirstenv) $ python3 -c “import django”
if you find nothing like error import message, it means you have successfully installed a django package inside a conda environment. and finally, you are ready to roll.
image credit : https://absurd.design