1 Setup Environment
1.1 Development environment
This is the program where you write your code, run your tests and debug your code.
Visual Studio Code
An open-source code editor, that can be extended to a full IDE with extensions: https://code.visualstudio.com/.
How to get started: https://code.visualstudio.com/docs
Suggested extensions:
- Python by Microsoft (Python language support)
- Jupyter by Microsoft (Jupyter notebook support)
- Black Formatter by Microsoft (Code formatter)
- Ruff by Astral Software (linter for code quality)
PyCharm
A full IDE for Python development. It has a free community edition and a paid professional edition.
Community edition: https://www.jetbrains.com/pycharm/ all you need to start working in Python.
Professional edition: https://www.jetbrains.com/pycharm/ contains support for web development, sql and remote development.
RStudio
The most popular IDE for R development. It has all tools needed for data science and data analysis: https://posit.co/download/rstudio-desktop/
Visual Studio Code
You can also use Visual Studio Code for R development.
Suggested extensions:
- R by Yuki Ueda (Rlanguagesupport)
1.2 Virtual environment
How to setup your packages and virtual environment. This is needed to avoid conflicts between different projects and to ensure that your code runs on different machines.
Conda
Conda is a package and virtual environment manager. It resolves dependencies of your python and non-python packages.
Install:
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
~/miniconda3/bin/conda init zsh
Cheat-sheet for Conda: moritzguck.github.io - Conda
Venv
Venv is a virtual environment manager that comes with Python. It is a lightweight alternative to Conda. The packages are installed directly in a designated folder in your project directory.
You can setup a virtual environment straight out of vscode:
- Press
Ctrl+Shift+P
to open the command palette. - Search for ‘Create environment’ and select the option ‘Python: Create Environment’.
- Choose Venv.
- Select the python version you want to use.
- If you have a requirements.txt file, you can select it to install the packages.
Poetry
Poetry is a package manager and environment manager. You can also use it to create packages that can be shared with others.
More info: https://python-poetry.org/
Cheat-sheet for Poetry: moritzguck.github.io - Poetry
Renv
Renv is an environment manager for R. It is quite similar to Python’s venv. Your packages will be installed in a designated folder in your project directory.
More info: https://rstudio.github.io/renv/articles/renv.html
You can setup a virtual environment straight out of RStudio:
- Create a new project.
- In the assistant select “use renv with this project”.