I am using Pydroid to code in android. Though it is an ARM machine so I downloaded OpenCV-python wheel from PiWheels and successfully installed it using pip. But i can't import OpenCV anyways. Please help.
Here is what I tried:
/storage/emulated/0 $ pip list
Package Version
------------------- -----------
android 1.0
appdirs 1.4.3
astroid 2.2.5
audiostream 0.2
certifi 2019.11.28
chardet 3.0.4
cPython 0.0.5
cycler 0.10.0
Cython 0.29.13
distlib 0.3.0
filelock 3.0.12
h5py 2.9.0
idna 2.9
importlib-metadata 1.5.0
isort 4.3.15
jedi 0.13.2
Keras 2.3.1
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
Kivy 1.11.0.dev0
kiwisolver 1.1.0
lazy-object-proxy 1.3.1
matplotlib 3.1.1
mccabe 0.6.1
numpy 1.16.2
opencv-python 4.1.1.26
pandas 0.25.1
parso 0.3.4
pip 19.0.3
pygame-sdl2 2.1.0
pyjnius 1.1.5.dev0
pylint 2.3.1
pymongo 3.10.1
pyparsing 2.4.6
PySDL2 0.9.4
python-dateutil 2.8.1
pytz 2019.3
PyYAML 5.3
requests 2.23.0
scikit-learn 0.20.2
scipy 1.3.1
setuptools 40.8.0
six 1.12.0
typed-ast 1.3.1
urllib3 1.25.8
virtualenv 20.0.10
virtualenv-tools 1.0
wheel 0.34.2
wrapt 1.11.1
zipp 3.1.0
/storage/emulated/0 $ python
Python 3.7.2 (default, Mar 20 2019, 14:25:26)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/cv2/__init__.py", line 3, in <module>
from .cv2 import *
ModuleNotFoundError: No module named 'cv2.cv2'
>>>
>>> import opencv-python
File "<stdin>", line 1
import opencv-python
^
SyntaxError: invalid syntax
>>>
>>> import cv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cv'
>>>
>>> import opencv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'opencv'
>>>
The name of the module is cv2.
Try import cv2
.
When I faced a similar problem in my laptop, installing opencv in a Conda environment did the job for me. Try removing opencv and try reinstalling it.