You can skip optional dependencies if you don't want. How to install Python 3.9 on Ubuntu 22.04 from source Step 1: Install required dependencies Step 2: Download compressed Python 3.9 package Step 3: Extract. Building OpenCV from sourceĬompiling from source may seem a little complicated at first, but once you succeeded in it, there is nothing complicated.įirst we will install some dependencies. Usually, Python comes preinstalled in many Linux distributions. Therefore, in this guide, we will show you how to install a specific version of Python on your Ubuntu system. Also at some point in time, if you want to contribute to OpenCV, you will need this. Similar is the case with Python, and as vigilant programmers, we must figure out the correct version that we need. So for getting latest source codes preference is next method, i.e.
Next, add the deadsnakes PPA to your sources list: sudo add-apt-repository ppa:deadsnakes/ppa. Start by updating the packages list and installing the prerequisites: sudo apt update sudo apt install software-properties-common. With respect to Python API, latest version will always contain much better support and latest bug fixes. How do I download Python 3.7 on Ubuntu Installing Python 3.7 on Ubuntu with Apt. For example, at the time of writing this tutorial, apt repository contains 2.4.8 while latest OpenCV version is 3.x.
For other versions of Ubuntu Desktop including torrents, the network installer, a list of local mirrors, and past releases see our alternative downloads. Apt repositories may not contain the latest version of OpenCV always. Either a DVD drive or a USB port for the installer media. If the results are printed out without any errors, congratulations !!! You have installed OpenCV-Python successfully.