I’ve installed OpenCV on Linux Mint and I can import it in python
JavaScript
x
(cv_env)➜ cv_env python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
>>> import cv2
>>> import numpy
>>> import scipy
But when I want to see it in pip freeze, it doesn’t appear:
JavaScript
(cv_env)➜ cv_env pip freeze
argparse==1.2.1
caffi==1.0.2
coffee==0.1.0
ffmpeg-python==0.1.6
future==0.16.0
imutils==0.4.3
numpy==1.13.3
pandas==0.20.3
python-dateutil==2.6.1
pytz==2017.2
scipy==0.19.1
six==1.11.0
wsgiref==0.1.2
Also, I tried to import it via PyCharm’s Project Interpreter. It wants to installation with pip. (pip install opencv-python and pip install cv2)
When I installed that, I followed these steps
What is the problem that I cannot see?
Advertisement
Answer
Those instructions are outdated, and using apt-get
puts pieces outside of the virtual environment, where pip
won’t see them to freeze.
Within a virtual environment, try
JavaScript
pip install --upgrade pip
pip install opencv-python
The --upgrade
might not be necessary, but has helped me out of weird pip
failures in the past.