Get your Data Science environment ready in Ubuntu 20.04

Jetbrains ToolBox

If you have previously worked with any Jetbrains software such as Pycharm, you will definitely find ToolBox very useful. It basically allows you to install and manage all Jetbrains software using a simple interface.

  1. Go to their website and download the tar.gz

NVIDIA Drivers [Optional]

This part only applies if your computer has a GPU.

sudo ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
sudo reboot

CUDA [Optional]

CUDA is basically a parallel computing platform to do mathematical operations using the GPU. It is a necessary requirement to train Deep Learning algorithms using tools such as Tensorflow or Pytorch.

sudo apt updatesudo apt install nvidia-cuda-toolkit
nvcc --versionf

Install virtualenv with Python 3

sudo apt-get install python3-pip
pip3 install virtualenv
which python3
virtualenv -p /home/username/opt/python-3.10.1/bin/python3 myPythonEnv


I first tried to install it using the Ubuntu Repository

sudo apt install libopencv-dev python3-opencv
while getopts p: flag
case "${flag}" in
p) path=${OPTARG};;
echo "path: $path";

sudo apt update
sudo apt upgrade
sudo apt-get install build-essential cmake unzip pkg-config -y
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev -y
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev -y
sudo apt-get install libxvidcore-dev libx264-dev -y
sudo apt-get install libgtk-3-dev -y
sudo apt-get install libatlas-base-dev gfortran -y
sudo apt-get install python3-dev -y
cd ~
rm -rf opencv
rm -rf opencv_contrib
wget -O
wget -O
mv opencv-4.5.0 opencv
mv opencv_contrib-4.5.0 opencv_contrib
cd ~/opencv
mkdir build
cd build
source ~/$path/bin/activate
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D PYTHON_EXECUTABLE=~/$path/bin/python \
make -j4
sudo make install
sudo ldconfig
cd /usr/local/lib/python3.8/site-packages/cv2/python-3.8
sudo mv
cd ~/$path/lib/python3.8/site-packages
ln -s /usr/local/lib/python3.8/site-packages/cv2/python-3.8/
bash -p .env/myPythonEnv


Many people would love to use Tensorflow, but I am a Pytorch guy, so sorry :).

pip install torch torchvision torchaudio


I hope this post has been of use to you. If you consider there is more software that should be in your basic Data Science setup, just leave it in the comments.




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Roberto Diaz

Roberto Diaz


Data Scientist. Passionate about tech. I write about Machine Learning and Cloud Computing.