Basic python setup
This page provides a set of instructions to set up python in a way that makes sense for developing plugins (or other projects on your local machine.
The following explanation is just one way to do it, and there are many ways, which may be better based on your specific needs and preferences.
Let’s start by downloading python and a package manager. Even if you already have python installed on your system, this is still a good idea. Download and install miniconda, a small version of Anaconda, a package manager for python. Note that after installing conda you need to reopen your terminal.
Now that we have conda set up, we can create an environment. An environment allows us to isolate all the dependencies for a project. We can activate the environment when we are working on the project, and switch to another environment when we are working on a another project.
Lets create an environment called
conda create --name my_env python=3.8
Now, we can activate the environment using:
conda activate my_env
We can deactivate using:
If we now run:
pip install <sompackage>
with the environment activated, and it will be installed in the environment.
Many data science projects use notebooks for exploration. A notebook allows to create and edit documents that integrate live code, output and explanatory text in a single document.
A basic setup for notebooks is:
pip install jupyter
Also, to be able to select your environment from a notebook:
conda install nb_conda_kernels
Learn more about jupyter here: www.jupyter.org.