SlideShare a Scribd company logo
1 of 9
Download to read offline
10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs
https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 1/9
 
Preparing Ubuntu 18.x-Based Linux 
for Using OpenCV 4.1, 
Python 3.7.x and PyCharm 2018.3.x 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Professor Shohreh Kasaei 
pkasaei@gmail.com 
 
Written by Nader Karimi 
Nader.karimi.b@gmail.com 
 
Digital Image Processing Course 
Spring, 2019 
Sharif University of Technology 
 
10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs
https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 2/9
Installing Python 3.7 on Ubuntu 18.x-based Linux 
 
Installing python 3.7 
Run the sequence of commands below: 
 
sudo apt update 
sudo apt install software-properties-common 
sudo add-apt-repository ppa:deadsnakes/ppa 
sudo apt install python3.7 
 
 
If those commands run successfully, you can run Python 3.7 by typing: 
 
python3.7 
 
 
 
If you want to use python3.7, be sure to type its name completely. If you just type python3, you 
may start python 3.6.x instead. 
 
Finding the absolute path to the python interpreter 
You can find the path to the installed interpreter by typing: 
 
which python3.7 
 
Which in my case is: 
 
/usr/bin/python3.7 
 
Installing pip 
You should install pip, which is a powerful package manager for python. Here is how to install 
for python3: 
 
sudo apt install python3-pip 
   
2 
10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs
https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 3/9
Installing and Using Virtual Environments for Python 
 
Installing virtualenv 
 
python3.7 -m pip install --user virtualenv 
 
Creating a new virtualenv with python3.7 as the default python interpreter 
First, create a directory for storing your virtual environments’ data. You can use your home 
directory for example: 
 
cd 
mkdir myenvs 
cd myenvs 
 
Now you are in the right path to create a new virtualenv. Create a new one by typing: 
 
python3.7 -m virtualenv env 
 
Activating a virtualenv 
First, change your working directory to the environments folder. In our case: 
 
cd ~/myenvs 
 
Then activate the environment you want, for example “env”, by typing: 
 
source env/bin/activate 
 
Your terminal should look like this after activating a virtualenv: 
Note that we just typed “python” without version number and we could start python 3.7. 
If you check python’s absolute path, you will notice that it is now pointing to a file in the specific 
virtualenv directory that is activated: 
 
/home/nader/env/bin/python 
 
Sometime it will still point to the system-wide python interpreter. If that happened for you, it’s ok. 
 
 
3 
10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs
https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 4/9
Deactivating the virtualenv 
Use this simple command to deactivate the activated virtualenv: 
 
deactivate   
4 
10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs
https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 5/9
Installing and Using Anaconda for Scientific 
Programming with Python 
 
Downloading and Installing Anaconda 
Download Anaconda for Linux from here. Don’t forget to choose Python 3.7 version. 
Change your directory to the download folder. Then enter the command below (check to see if 
the name of your file is different): 
 
bash Anaconda3-5.2.0-Linux-x86_64.sh 
 
and answer to the prompts till you finish installing it. 
 
Creating a new virtualenv with python3.7.2 as the default python using conda 
Conda is the package manager, somehow similar to pip, which comes with Anaconda. We can 
create and manage virtual environments with it, too. 
Here we create a new virtual environment using conda. We specify that we want the python to 
be version 3.7.2, although we have not installed this version on our machine. Conda will handle 
downloading and installing it for us! Also, we don’t need to think about where to store our 
virtualenvs since conda has a default path for that. 
 
Type these command to create a new virtualenv named “cenv” (which stands for conda env): 
 
conda create -n cenv python=3.7.2 
 
Finish the process by answering to the prompts it gives you. Note that we specify the name of 
the virtualenv after “-n”. 
 
Activating and deactivating a virtualenv using conda 
We show how to activate and deactivate virtualenvs in the picture below. See how easy it is to 
activate and deactivate a virtualenv using the command “source”. We don’t have to worry about 
any system path while working with conda virtualenvs. 
Note that instead of the command ‘source’, you can use the equivalent command ‘conda’. For 
example, instead of using: 
source activate 
you can use: 
conda activate 
5 
10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs
https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 6/9
   
6 
10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs
https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 7/9
Installing OpenCV 4.1 in an Activated Virtualenv 
First, activate the virtualenv you want to use. Then type this command to install opencv version 
4.x.x (the latest version will be installed): 
 
pip install opencv-python 
 
For installing other versions, find the appropriate command from this link. 
You can check if it is installed correctly like this: 
   
7 
10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs
https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 8/9
Installing and Configuring PyCharm for Using a Virtual 
Environment 
 
First, download PyCharm from here. You may want to download the free, community edition file. 
Next, unzip the tar.gz file using this command: 
 
tar -xvzf pycharm_filename.tar.gz 
 
Then go to PyCharm folder, and next to the “bin” folder and start pycharm like this: 
 
 
Note that there is a file named “Install-Linux-tar.txt” in the PyCharm folder. You can check that 
for further information about using PyCharm. 
 
As we like to work with virtualenvs, we should instruct PyCharm to use our desired virtualenv. 
You can use the pictures below for guidance. Start PyCharm and create a new project. Open 
the Project Interpreter drop-down menu, choose existing interpreter and click on the button right 
to it. Another windows will pop up. There is a button right to the Interpreter text field. Click on 
that, and in the opened window, enter the path of the python interpreter of your virtualenv. You 
can find that path by using “which” command, as explained before. Commit this changes and 
finish making the new project. 
8 
10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs
https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 9/956
 
Finally, you can create a launcher for PyCharm, so that you won’t have to start it from 
command-line each time. Start PyCharm, go to tools, and click on “Create Desktop Entry …”. 
Enjoy! 
9 

More Related Content

What's hot

Docker & Kubernetes
Docker & KubernetesDocker & Kubernetes
Docker & KubernetesTroy Harvey
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechChristopher Bumgardner
 
uWSGI - Swiss army knife for your Python web apps
uWSGI - Swiss army knife for your Python web appsuWSGI - Swiss army knife for your Python web apps
uWSGI - Swiss army knife for your Python web appsTomislav Raseta
 
Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersSagar Acharya
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker皓鈞 張
 
Simple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottleSimple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottleJordi Soucheiron
 
TYPO3 CMS deployment with Jenkins CI
TYPO3 CMS deployment with Jenkins CITYPO3 CMS deployment with Jenkins CI
TYPO3 CMS deployment with Jenkins CIderdanne
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngineOhio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngineNick Anderson
 
Meetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.ioMeetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.ioUilian Ries
 
Run Docker On Windows Using Vagrant
Run Docker On Windows Using VagrantRun Docker On Windows Using Vagrant
Run Docker On Windows Using VagrantJulien Barbier
 
Pip + virtualenv
Pip + virtualenvPip + virtualenv
Pip + virtualenvDaryl Yu
 
Continuous Delivery di una WebApp - by example
Continuous Delivery di una WebApp - by exampleContinuous Delivery di una WebApp - by example
Continuous Delivery di una WebApp - by exampleFabio Mora
 
Terminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceTerminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceJon Peck
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvMarkus Zapke-Gründemann
 
Big Fat FastPlone - Scale up, speed up
Big Fat FastPlone - Scale up, speed upBig Fat FastPlone - Scale up, speed up
Big Fat FastPlone - Scale up, speed upJens Klein
 
Towards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineKrimson
 

What's hot (20)

Docker & Kubernetes
Docker & KubernetesDocker & Kubernetes
Docker & Kubernetes
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ Benetech
 
uWSGI - Swiss army knife for your Python web apps
uWSGI - Swiss army knife for your Python web appsuWSGI - Swiss army knife for your Python web apps
uWSGI - Swiss army knife for your Python web apps
 
Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for Beginners
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Simple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottleSimple webapps with nginx, uwsgi emperor and bottle
Simple webapps with nginx, uwsgi emperor and bottle
 
TYPO3 CMS deployment with Jenkins CI
TYPO3 CMS deployment with Jenkins CITYPO3 CMS deployment with Jenkins CI
TYPO3 CMS deployment with Jenkins CI
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngineOhio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
 
Meetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.ioMeetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.io
 
Run Docker On Windows Using Vagrant
Run Docker On Windows Using VagrantRun Docker On Windows Using Vagrant
Run Docker On Windows Using Vagrant
 
Pip + virtualenv
Pip + virtualenvPip + virtualenv
Pip + virtualenv
 
Continuous Delivery di una WebApp - by example
Continuous Delivery di una WebApp - by exampleContinuous Delivery di una WebApp - by example
Continuous Delivery di una WebApp - by example
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
 
Terminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceTerminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interface
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
Big Fat FastPlone - Scale up, speed up
Big Fat FastPlone - Scale up, speed upBig Fat FastPlone - Scale up, speed up
Big Fat FastPlone - Scale up, speed up
 
Towards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev Machine
 

Similar to Installing OpenCV 4 on Ubuntu 18.x

A Hands-On Set of Programming Problems Using Python and OpenCV
A Hands-On Set of Programming Problems Using Python and OpenCVA Hands-On Set of Programming Problems Using Python and OpenCV
A Hands-On Set of Programming Problems Using Python and OpenCVNader Karimi
 
Steps to install ns3
Steps to install ns3Steps to install ns3
Steps to install ns3DIGITAL PADM
 
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideAWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideRapidValue
 
5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenvamenasse
 
Installing Python on Mac
Installing Python on MacInstalling Python on Mac
Installing Python on MacWei-Wen Hsu
 
Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Henry Schreiner
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingHenry Schreiner
 
Mpeg guide
Mpeg  guideMpeg  guide
Mpeg guidekimsach
 
Installation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling firstInstallation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling firstJawad Khan
 
Ansible Workshop for Pythonistas
Ansible Workshop for PythonistasAnsible Workshop for Pythonistas
Ansible Workshop for PythonistasMihai Criveti
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationPASCAL Jean Marie
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
PVS-Studio in the Clouds: Travis CI
PVS-Studio in the Clouds: Travis CIPVS-Studio in the Clouds: Travis CI
PVS-Studio in the Clouds: Travis CIAndrey Karpov
 
Digital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingDigital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingHenry Schreiner
 
Drupalcamp es 2013 drupal with lxc docker and vagrant
Drupalcamp es 2013  drupal with lxc docker and vagrant Drupalcamp es 2013  drupal with lxc docker and vagrant
Drupalcamp es 2013 drupal with lxc docker and vagrant Ricardo Amaro
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017MarcinStachniuk
 
Installing nagios core_from_source
Installing nagios core_from_sourceInstalling nagios core_from_source
Installing nagios core_from_sourcelaonap166
 
Orangescrum In App Chat Add-on User Manual
Orangescrum In App Chat Add-on User ManualOrangescrum In App Chat Add-on User Manual
Orangescrum In App Chat Add-on User ManualOrangescrum
 

Similar to Installing OpenCV 4 on Ubuntu 18.x (20)

A Hands-On Set of Programming Problems Using Python and OpenCV
A Hands-On Set of Programming Problems Using Python and OpenCVA Hands-On Set of Programming Problems Using Python and OpenCV
A Hands-On Set of Programming Problems Using Python and OpenCV
 
Steps to install ns3
Steps to install ns3Steps to install ns3
Steps to install ns3
 
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideAWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
 
5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenv
 
Installing Python on Mac
Installing Python on MacInstalling Python on Mac
Installing Python on Mac
 
Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance Tooling
 
Mpeg guide
Mpeg  guideMpeg  guide
Mpeg guide
 
Installation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling firstInstallation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling first
 
LIGGGHTS installation-guide
LIGGGHTS installation-guideLIGGGHTS installation-guide
LIGGGHTS installation-guide
 
Python Projects at Neova
Python Projects at NeovaPython Projects at Neova
Python Projects at Neova
 
Ansible Workshop for Pythonistas
Ansible Workshop for PythonistasAnsible Workshop for Pythonistas
Ansible Workshop for Pythonistas
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous Integration
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
PVS-Studio in the Clouds: Travis CI
PVS-Studio in the Clouds: Travis CIPVS-Studio in the Clouds: Travis CI
PVS-Studio in the Clouds: Travis CI
 
Digital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingDigital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meeting
 
Drupalcamp es 2013 drupal with lxc docker and vagrant
Drupalcamp es 2013  drupal with lxc docker and vagrant Drupalcamp es 2013  drupal with lxc docker and vagrant
Drupalcamp es 2013 drupal with lxc docker and vagrant
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
Installing nagios core_from_source
Installing nagios core_from_sourceInstalling nagios core_from_source
Installing nagios core_from_source
 
Orangescrum In App Chat Add-on User Manual
Orangescrum In App Chat Add-on User ManualOrangescrum In App Chat Add-on User Manual
Orangescrum In App Chat Add-on User Manual
 

Recently uploaded

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 

Recently uploaded (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 

Installing OpenCV 4 on Ubuntu 18.x

  • 1. 10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 1/9   Preparing Ubuntu 18.x-Based Linux  for Using OpenCV 4.1,  Python 3.7.x and PyCharm 2018.3.x                                          Professor Shohreh Kasaei  pkasaei@gmail.com    Written by Nader Karimi  Nader.karimi.b@gmail.com    Digital Image Processing Course  Spring, 2019  Sharif University of Technology   
  • 2. 10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 2/9 Installing Python 3.7 on Ubuntu 18.x-based Linux    Installing python 3.7  Run the sequence of commands below:    sudo apt update  sudo apt install software-properties-common  sudo add-apt-repository ppa:deadsnakes/ppa  sudo apt install python3.7      If those commands run successfully, you can run Python 3.7 by typing:    python3.7        If you want to use python3.7, be sure to type its name completely. If you just type python3, you  may start python 3.6.x instead.    Finding the absolute path to the python interpreter  You can find the path to the installed interpreter by typing:    which python3.7    Which in my case is:    /usr/bin/python3.7    Installing pip  You should install pip, which is a powerful package manager for python. Here is how to install  for python3:    sudo apt install python3-pip      2 
  • 3. 10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 3/9 Installing and Using Virtual Environments for Python    Installing virtualenv    python3.7 -m pip install --user virtualenv    Creating a new virtualenv with python3.7 as the default python interpreter  First, create a directory for storing your virtual environments’ data. You can use your home  directory for example:    cd  mkdir myenvs  cd myenvs    Now you are in the right path to create a new virtualenv. Create a new one by typing:    python3.7 -m virtualenv env    Activating a virtualenv  First, change your working directory to the environments folder. In our case:    cd ~/myenvs    Then activate the environment you want, for example “env”, by typing:    source env/bin/activate    Your terminal should look like this after activating a virtualenv:  Note that we just typed “python” without version number and we could start python 3.7.  If you check python’s absolute path, you will notice that it is now pointing to a file in the specific  virtualenv directory that is activated:    /home/nader/env/bin/python    Sometime it will still point to the system-wide python interpreter. If that happened for you, it’s ok.      3 
  • 4. 10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 4/9 Deactivating the virtualenv  Use this simple command to deactivate the activated virtualenv:    deactivate    4 
  • 5. 10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 5/9 Installing and Using Anaconda for Scientific  Programming with Python    Downloading and Installing Anaconda  Download Anaconda for Linux from here. Don’t forget to choose Python 3.7 version.  Change your directory to the download folder. Then enter the command below (check to see if  the name of your file is different):    bash Anaconda3-5.2.0-Linux-x86_64.sh    and answer to the prompts till you finish installing it.    Creating a new virtualenv with python3.7.2 as the default python using conda  Conda is the package manager, somehow similar to pip, which comes with Anaconda. We can  create and manage virtual environments with it, too.  Here we create a new virtual environment using conda. We specify that we want the python to  be version 3.7.2, although we have not installed this version on our machine. Conda will handle  downloading and installing it for us! Also, we don’t need to think about where to store our  virtualenvs since conda has a default path for that.    Type these command to create a new virtualenv named “cenv” (which stands for conda env):    conda create -n cenv python=3.7.2    Finish the process by answering to the prompts it gives you. Note that we specify the name of  the virtualenv after “-n”.    Activating and deactivating a virtualenv using conda  We show how to activate and deactivate virtualenvs in the picture below. See how easy it is to  activate and deactivate a virtualenv using the command “source”. We don’t have to worry about  any system path while working with conda virtualenvs.  Note that instead of the command ‘source’, you can use the equivalent command ‘conda’. For  example, instead of using:  source activate  you can use:  conda activate  5 
  • 6. 10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 6/9     6 
  • 7. 10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 7/9 Installing OpenCV 4.1 in an Activated Virtualenv  First, activate the virtualenv you want to use. Then type this command to install opencv version  4.x.x (the latest version will be installed):    pip install opencv-python    For installing other versions, find the appropriate command from this link.  You can check if it is installed correctly like this:      7 
  • 8. 10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 8/9 Installing and Configuring PyCharm for Using a Virtual  Environment    First, download PyCharm from here. You may want to download the free, community edition file.  Next, unzip the tar.gz file using this command:    tar -xvzf pycharm_filename.tar.gz    Then go to PyCharm folder, and next to the “bin” folder and start pycharm like this:      Note that there is a file named “Install-Linux-tar.txt” in the PyCharm folder. You can check that  for further information about using PyCharm.    As we like to work with virtualenvs, we should instruct PyCharm to use our desired virtualenv.  You can use the pictures below for guidance. Start PyCharm and create a new project. Open  the Project Interpreter drop-down menu, choose existing interpreter and click on the button right  to it. Another windows will pop up. There is a button right to the Interpreter text field. Click on  that, and in the opened window, enter the path of the python interpreter of your virtualenv. You  can find that path by using “which” command, as explained before. Commit this changes and  finish making the new project.  8 
  • 9. 10/5/2019 OpenCV_Linux_Installation_Guide - Google Docs https://docs.google.com/document/d/1LC6XlasyLBa21YvGfipwcheRSzab3f_PqUBiRsFIB30/edit 9/956   Finally, you can create a launcher for PyCharm, so that you won’t have to start it from  command-line each time. Start PyCharm, go to tools, and click on “Create Desktop Entry …”.  Enjoy!  9