How to install OpenCV 2.4.7 for Python , Ubuntu
I am going to use a code shared on GitHub on facial feature extraction. This code has OpenCV 2.4.7 and Python 2.7 dependencies. I tried OpenCV 3.4, but it didn't work. This code uses cv2.Boost() which is not found in OpenCV 3.4.
Also, pypi only support OpenCV 3x. I couldn't install OpenCV 2.4.7 by pip install.
Please let me know how I can install OpenCV 2.4.7 for Python? I prefer to install it in a Conda virtual environment.
O.S: Ubuntu 16;
I can use Windows 10 too.
python opencv ubuntu install
add a comment |
I am going to use a code shared on GitHub on facial feature extraction. This code has OpenCV 2.4.7 and Python 2.7 dependencies. I tried OpenCV 3.4, but it didn't work. This code uses cv2.Boost() which is not found in OpenCV 3.4.
Also, pypi only support OpenCV 3x. I couldn't install OpenCV 2.4.7 by pip install.
Please let me know how I can install OpenCV 2.4.7 for Python? I prefer to install it in a Conda virtual environment.
O.S: Ubuntu 16;
I can use Windows 10 too.
python opencv ubuntu install
add a comment |
I am going to use a code shared on GitHub on facial feature extraction. This code has OpenCV 2.4.7 and Python 2.7 dependencies. I tried OpenCV 3.4, but it didn't work. This code uses cv2.Boost() which is not found in OpenCV 3.4.
Also, pypi only support OpenCV 3x. I couldn't install OpenCV 2.4.7 by pip install.
Please let me know how I can install OpenCV 2.4.7 for Python? I prefer to install it in a Conda virtual environment.
O.S: Ubuntu 16;
I can use Windows 10 too.
python opencv ubuntu install
I am going to use a code shared on GitHub on facial feature extraction. This code has OpenCV 2.4.7 and Python 2.7 dependencies. I tried OpenCV 3.4, but it didn't work. This code uses cv2.Boost() which is not found in OpenCV 3.4.
Also, pypi only support OpenCV 3x. I couldn't install OpenCV 2.4.7 by pip install.
Please let me know how I can install OpenCV 2.4.7 for Python? I prefer to install it in a Conda virtual environment.
O.S: Ubuntu 16;
I can use Windows 10 too.
python opencv ubuntu install
python opencv ubuntu install
asked Nov 26 '18 at 3:40
MohammadMohammad
64
64
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I think you could build the OpenCV from source, so you can choose the branch (version) you want to use:
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
cd ~
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 2.4
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j7
sudo make install
Good luck!
1
However, I suggest using the latest version of OpenCV if possible, which is surely more powerful.
– Howard GENG
Nov 26 '18 at 5:52
Thanks. How can I import the built OpenCV in Spyder or PyCharm running in a conda virtual environment?
– Mohammad
Nov 26 '18 at 7:09
It should compile the OpenCV library with its support extension of Python. You should be able to use it as the following: import cv2
– Howard GENG
Nov 26 '18 at 11:19
add a comment |
pip install opencv-python==2.4.7
For python3 try:
pip3 install opencv-python==2.4.7
However, before you install opencv, have numpy and matplotlib installed.
pip install numpy
pip install matplotlib
Thanks, I installed numpy and matplotlib. I tried "pip install opencv-python==2.4.7", but I got the error message: "Could not find a version that satisfies the requirement opencv-python==2.4.7 (from versions: 3.1.0.0, 3.1.0.1, 3.1.0.2, 3.1.0.3, 3.1.0.4, 3.1.0.5, 3.2.0.6, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10, 3.3.1.11, 3.4.0.12, 3.4.0.14, 3.4.1.15, 3.4.2.16, 3.4.2.17, 3.4.3.18) No matching distribution found for opencv-python==2.4.7"
– Mohammad
Nov 26 '18 at 4:48
It seems OpenCV 2.4 version is no longer supported on the distribution repo.
– Howard GENG
Nov 26 '18 at 5:37
@HowardGENG my bad. Should I delete my answer? As it is no longer applicable.
– Azazel
Nov 26 '18 at 13:15
It is up to you. You answer works well for other versions.
– Howard GENG
Nov 26 '18 at 21:18
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53474508%2fhow-to-install-opencv-2-4-7-for-python-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think you could build the OpenCV from source, so you can choose the branch (version) you want to use:
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
cd ~
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 2.4
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j7
sudo make install
Good luck!
1
However, I suggest using the latest version of OpenCV if possible, which is surely more powerful.
– Howard GENG
Nov 26 '18 at 5:52
Thanks. How can I import the built OpenCV in Spyder or PyCharm running in a conda virtual environment?
– Mohammad
Nov 26 '18 at 7:09
It should compile the OpenCV library with its support extension of Python. You should be able to use it as the following: import cv2
– Howard GENG
Nov 26 '18 at 11:19
add a comment |
I think you could build the OpenCV from source, so you can choose the branch (version) you want to use:
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
cd ~
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 2.4
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j7
sudo make install
Good luck!
1
However, I suggest using the latest version of OpenCV if possible, which is surely more powerful.
– Howard GENG
Nov 26 '18 at 5:52
Thanks. How can I import the built OpenCV in Spyder or PyCharm running in a conda virtual environment?
– Mohammad
Nov 26 '18 at 7:09
It should compile the OpenCV library with its support extension of Python. You should be able to use it as the following: import cv2
– Howard GENG
Nov 26 '18 at 11:19
add a comment |
I think you could build the OpenCV from source, so you can choose the branch (version) you want to use:
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
cd ~
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 2.4
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j7
sudo make install
Good luck!
I think you could build the OpenCV from source, so you can choose the branch (version) you want to use:
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
cd ~
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 2.4
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j7
sudo make install
Good luck!
answered Nov 26 '18 at 5:36
Howard GENGHoward GENG
5338
5338
1
However, I suggest using the latest version of OpenCV if possible, which is surely more powerful.
– Howard GENG
Nov 26 '18 at 5:52
Thanks. How can I import the built OpenCV in Spyder or PyCharm running in a conda virtual environment?
– Mohammad
Nov 26 '18 at 7:09
It should compile the OpenCV library with its support extension of Python. You should be able to use it as the following: import cv2
– Howard GENG
Nov 26 '18 at 11:19
add a comment |
1
However, I suggest using the latest version of OpenCV if possible, which is surely more powerful.
– Howard GENG
Nov 26 '18 at 5:52
Thanks. How can I import the built OpenCV in Spyder or PyCharm running in a conda virtual environment?
– Mohammad
Nov 26 '18 at 7:09
It should compile the OpenCV library with its support extension of Python. You should be able to use it as the following: import cv2
– Howard GENG
Nov 26 '18 at 11:19
1
1
However, I suggest using the latest version of OpenCV if possible, which is surely more powerful.
– Howard GENG
Nov 26 '18 at 5:52
However, I suggest using the latest version of OpenCV if possible, which is surely more powerful.
– Howard GENG
Nov 26 '18 at 5:52
Thanks. How can I import the built OpenCV in Spyder or PyCharm running in a conda virtual environment?
– Mohammad
Nov 26 '18 at 7:09
Thanks. How can I import the built OpenCV in Spyder or PyCharm running in a conda virtual environment?
– Mohammad
Nov 26 '18 at 7:09
It should compile the OpenCV library with its support extension of Python. You should be able to use it as the following: import cv2
– Howard GENG
Nov 26 '18 at 11:19
It should compile the OpenCV library with its support extension of Python. You should be able to use it as the following: import cv2
– Howard GENG
Nov 26 '18 at 11:19
add a comment |
pip install opencv-python==2.4.7
For python3 try:
pip3 install opencv-python==2.4.7
However, before you install opencv, have numpy and matplotlib installed.
pip install numpy
pip install matplotlib
Thanks, I installed numpy and matplotlib. I tried "pip install opencv-python==2.4.7", but I got the error message: "Could not find a version that satisfies the requirement opencv-python==2.4.7 (from versions: 3.1.0.0, 3.1.0.1, 3.1.0.2, 3.1.0.3, 3.1.0.4, 3.1.0.5, 3.2.0.6, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10, 3.3.1.11, 3.4.0.12, 3.4.0.14, 3.4.1.15, 3.4.2.16, 3.4.2.17, 3.4.3.18) No matching distribution found for opencv-python==2.4.7"
– Mohammad
Nov 26 '18 at 4:48
It seems OpenCV 2.4 version is no longer supported on the distribution repo.
– Howard GENG
Nov 26 '18 at 5:37
@HowardGENG my bad. Should I delete my answer? As it is no longer applicable.
– Azazel
Nov 26 '18 at 13:15
It is up to you. You answer works well for other versions.
– Howard GENG
Nov 26 '18 at 21:18
add a comment |
pip install opencv-python==2.4.7
For python3 try:
pip3 install opencv-python==2.4.7
However, before you install opencv, have numpy and matplotlib installed.
pip install numpy
pip install matplotlib
Thanks, I installed numpy and matplotlib. I tried "pip install opencv-python==2.4.7", but I got the error message: "Could not find a version that satisfies the requirement opencv-python==2.4.7 (from versions: 3.1.0.0, 3.1.0.1, 3.1.0.2, 3.1.0.3, 3.1.0.4, 3.1.0.5, 3.2.0.6, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10, 3.3.1.11, 3.4.0.12, 3.4.0.14, 3.4.1.15, 3.4.2.16, 3.4.2.17, 3.4.3.18) No matching distribution found for opencv-python==2.4.7"
– Mohammad
Nov 26 '18 at 4:48
It seems OpenCV 2.4 version is no longer supported on the distribution repo.
– Howard GENG
Nov 26 '18 at 5:37
@HowardGENG my bad. Should I delete my answer? As it is no longer applicable.
– Azazel
Nov 26 '18 at 13:15
It is up to you. You answer works well for other versions.
– Howard GENG
Nov 26 '18 at 21:18
add a comment |
pip install opencv-python==2.4.7
For python3 try:
pip3 install opencv-python==2.4.7
However, before you install opencv, have numpy and matplotlib installed.
pip install numpy
pip install matplotlib
pip install opencv-python==2.4.7
For python3 try:
pip3 install opencv-python==2.4.7
However, before you install opencv, have numpy and matplotlib installed.
pip install numpy
pip install matplotlib
answered Nov 26 '18 at 3:56
AzazelAzazel
878
878
Thanks, I installed numpy and matplotlib. I tried "pip install opencv-python==2.4.7", but I got the error message: "Could not find a version that satisfies the requirement opencv-python==2.4.7 (from versions: 3.1.0.0, 3.1.0.1, 3.1.0.2, 3.1.0.3, 3.1.0.4, 3.1.0.5, 3.2.0.6, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10, 3.3.1.11, 3.4.0.12, 3.4.0.14, 3.4.1.15, 3.4.2.16, 3.4.2.17, 3.4.3.18) No matching distribution found for opencv-python==2.4.7"
– Mohammad
Nov 26 '18 at 4:48
It seems OpenCV 2.4 version is no longer supported on the distribution repo.
– Howard GENG
Nov 26 '18 at 5:37
@HowardGENG my bad. Should I delete my answer? As it is no longer applicable.
– Azazel
Nov 26 '18 at 13:15
It is up to you. You answer works well for other versions.
– Howard GENG
Nov 26 '18 at 21:18
add a comment |
Thanks, I installed numpy and matplotlib. I tried "pip install opencv-python==2.4.7", but I got the error message: "Could not find a version that satisfies the requirement opencv-python==2.4.7 (from versions: 3.1.0.0, 3.1.0.1, 3.1.0.2, 3.1.0.3, 3.1.0.4, 3.1.0.5, 3.2.0.6, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10, 3.3.1.11, 3.4.0.12, 3.4.0.14, 3.4.1.15, 3.4.2.16, 3.4.2.17, 3.4.3.18) No matching distribution found for opencv-python==2.4.7"
– Mohammad
Nov 26 '18 at 4:48
It seems OpenCV 2.4 version is no longer supported on the distribution repo.
– Howard GENG
Nov 26 '18 at 5:37
@HowardGENG my bad. Should I delete my answer? As it is no longer applicable.
– Azazel
Nov 26 '18 at 13:15
It is up to you. You answer works well for other versions.
– Howard GENG
Nov 26 '18 at 21:18
Thanks, I installed numpy and matplotlib. I tried "pip install opencv-python==2.4.7", but I got the error message: "Could not find a version that satisfies the requirement opencv-python==2.4.7 (from versions: 3.1.0.0, 3.1.0.1, 3.1.0.2, 3.1.0.3, 3.1.0.4, 3.1.0.5, 3.2.0.6, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10, 3.3.1.11, 3.4.0.12, 3.4.0.14, 3.4.1.15, 3.4.2.16, 3.4.2.17, 3.4.3.18) No matching distribution found for opencv-python==2.4.7"
– Mohammad
Nov 26 '18 at 4:48
Thanks, I installed numpy and matplotlib. I tried "pip install opencv-python==2.4.7", but I got the error message: "Could not find a version that satisfies the requirement opencv-python==2.4.7 (from versions: 3.1.0.0, 3.1.0.1, 3.1.0.2, 3.1.0.3, 3.1.0.4, 3.1.0.5, 3.2.0.6, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10, 3.3.1.11, 3.4.0.12, 3.4.0.14, 3.4.1.15, 3.4.2.16, 3.4.2.17, 3.4.3.18) No matching distribution found for opencv-python==2.4.7"
– Mohammad
Nov 26 '18 at 4:48
It seems OpenCV 2.4 version is no longer supported on the distribution repo.
– Howard GENG
Nov 26 '18 at 5:37
It seems OpenCV 2.4 version is no longer supported on the distribution repo.
– Howard GENG
Nov 26 '18 at 5:37
@HowardGENG my bad. Should I delete my answer? As it is no longer applicable.
– Azazel
Nov 26 '18 at 13:15
@HowardGENG my bad. Should I delete my answer? As it is no longer applicable.
– Azazel
Nov 26 '18 at 13:15
It is up to you. You answer works well for other versions.
– Howard GENG
Nov 26 '18 at 21:18
It is up to you. You answer works well for other versions.
– Howard GENG
Nov 26 '18 at 21:18
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53474508%2fhow-to-install-opencv-2-4-7-for-python-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown