Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'cv_version' #83

Closed
djadk84 opened this issue Apr 10, 2018 · 11 comments
Closed

No module named 'cv_version' #83

djadk84 opened this issue Apr 10, 2018 · 11 comments

Comments

@djadk84
Copy link

djadk84 commented Apr 10, 2018

Expected behaviour

I'm trying to import OpenCV-python to pkgsrc and I'm using python 3.6. When I tried to install the pkg it breaks. I would I appreciate any help to fix this. also, I have all depends install.

Actual behaviour

===> Configuring for py36-opencv-3.4.0.12
=> Fixing locale directory references.
=> Checking for portability problems in extracted files
cd /usr/pkgsrc/wip/py-opencv/work/opencv-python-12 && /usr/bin/env FREETYPE_CONFIG=/usr/pkg/bin/freetype-config PTHREAD_CFLAGS=\ -pthread\ PTHREAD_LDFLAGS=\ -pthread PTHREAD_LIBS=-lpthread\ -lrt PTHREADBASE=/usr QTDIR=/usr/pkg/qt4 MOC="/usr/pkg/qt4/bin/moc" UIC="/usr/pkg/qt4/bin/uic" QMAKE="/usr/pkg/qt4/bin/qmake" QMAKESPEC=/usr/pkg/qt4/mkspecs/netbsd-g++ DL_CFLAGS= DL_LDFLAGS= DL_LIBS= INSTALL_INFO= MAKEINFO=/usr/pkgsrc/wip/py-opencv/work/.tools/bin/makeinfo FLEX= BISON= PKG_CONFIG=/usr/pkgsrc/wip/py-opencv/work/.tools/bin/pkg-config PKG_CONFIG_LIBDIR=/usr/pkgsrc/wip/py-opencv/work/.buildlink/lib64/pkgconfig:/usr/pkgsrc/wip/py-opencv/work/.buildlink/lib/pkgconfig:/usr/pkgsrc/wip/py-opencv/work/.buildlink/share/pkgconfig PKG_CONFIG_LOG=/usr/pkgsrc/wip/py-opencv/work/.pkg-config.log PKG_CONFIG_PATH= MAKE=make CWRAPPERS_CONFIG_DIR=/usr/pkgsrc/wip/py-opencv/work/.cwrapper/config PYTHON=/usr/pkg/bin/python3.6 CC=cc CFLAGS=-O2\ -march=native\ -mfpmath=sse\ -msse3\ -g\ -D_FORTIFY_SOURCE=2\ -I/usr/pkg/include\ -I/usr/pkg/qt4/include\ -I/usr/include\ -I/usr/pkg/include/freetype2\ -I/usr/pkg/include/libdrm\ -I/usr/pkg/include/python3.6 CPPFLAGS=-I/usr/pkg/include\ -I/usr/pkg/qt4/include\ -I/usr/include\ -I/usr/pkg/include/freetype2\ -I/usr/pkg/include/libdrm\ -I/usr/pkg/include/python3.6 CXX=c++ CXXFLAGS=-O2\ -march=native\ -mfpmath=sse\ -msse3\ -g\ -D_FORTIFY_SOURCE=2\ -I/usr/pkg/include\ -I/usr/pkg/qt4/include\ -I/usr/include\ -I/usr/pkg/include/freetype2\ -I/usr/pkg/include/libdrm\ -I/usr/pkg/include/python3.6 COMPILER_RPATH_FLAG=-Wl,-R F77=gfortran FC=gfortran FFLAGS=-O LANG=C LC_ALL=C LC_COLLATE=C LC_CTYPE=C LC_MESSAGES=C LC_MONETARY=C LC_NUMERIC=C LC_TIME=C LDFLAGS=-lgcc_s\ -lgcc\ -lgfortran\ -lquadmath\ -L/usr/pkg/lib\ -L/usr/pkg/qt4/lib\ -Wl,-R/usr/pkg/qt4/lib\ -L/usr/lib64\ -Wl,-R/usr/lib64\ -Wl,-R/usr/pkg/lib LINKER_RPATH_FLAG=-R PATH=/usr/pkgsrc/wip/py-opencv/work/.cwrapper/bin:/usr/pkgsrc/wip/py-opencv/work/.buildlink/bin:/usr/pkgsrc/wip/py-opencv/work/.gcc/bin:/usr/pkgsrc/wip/py-opencv/work/.tools/bin:/usr/pkg/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin:/usr/local/cuda/bin:/root/bin:/usr/pkg/bin:/usr/pkg/bin PREFIX=/usr/pkg MAKELEVEL=0 CONFIG_SITE= PKG_SYSCONFDIR=/usr/pkg/etc HOME=/usr/pkgsrc/wip/py-opencv/work/.home CWRAPPERS_CONFIG_DIR=/usr/pkgsrc/wip/py-opencv/work/.cwrapper/config /usr/pkg/bin/python3.6 setup.py build install
Traceback (most recent call last):
File "setup.py", line 9, in
from cv_version import opencv_version
ModuleNotFoundError: No module named 'cv_version'
*** Error code 1

Stop.
bmake[1]: stopped in /usr/pkgsrc/wip/py-opencv
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/wip/py-opencv

Steps to reproduce

/usr/pkg/bin/python3.6 setup.py build install

  • example code
  • operating system
    Centos 7
  • architecture (e.g. x86)
    uname -p
    x86_64
  • opencv-python version
    opencv-python-12
@skvark
Copy link
Member

skvark commented Apr 11, 2018

Local builds are not yet supported. That's why you are getting the error. See #43.

@djadk84
Copy link
Author

djadk84 commented Apr 11, 2018

@skvark Ok I understand, Will be waiting for you guys to have this implemented soon if possible.

@djadk84
Copy link
Author

djadk84 commented Apr 11, 2018

Also, I have to mention If I try to install it via pip its only work for python 2.7 with python 3.6 I get the following error:

pip install opencv-python==3.3.1.11
Collecting opencv-python==3.3.1.11
Could not find a version that satisfies the requirement opencv-python==3.3.1.11 (from versions: )
No matching distribution found for opencv-python==3.3.1.11

@skvark
Copy link
Member

skvark commented Apr 11, 2018

Your pip is most likely too old. Upgrade it with pip install --upgrade pip.

@djadk84
Copy link
Author

djadk84 commented Apr 12, 2018

I do believe I'm running the last version of pip

$ pip --version
pip 9.0.3 from ~/pkgenv/lib/python3.6/site-packages (python 3.6)

$ pip install --upgrade pip
Requirement already up-to-date: pip in ./pkgenv/lib/python3.6/site-packages

@skvark
Copy link
Member

skvark commented Apr 13, 2018

That's odd, it should work. I presume that you are running some GNU/Linux distribution with standard glibc? Have you tried to install it manually? Download the correct wheel file from PyPI (https://pypi.python.org/pypi/opencv-python/3.3.1.11) and run for example pip install opencv_python-3.3.1.11-cp36-cp36m-manylinux1_x86_64.whl

@djadk84
Copy link
Author

djadk84 commented Apr 13, 2018

I'm running centos 7 with pkgsrc. I have also tried to install it locally but it failed

cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

$ pip install opencv_python-3.3.1.11-cp36-cp36m-manylinux1_x86_64.whl
opencv_python-3.3.1.11-cp36-cp36m-manylinux1_x86_64.whl is not a supported wheel on this platform.

@skvark
Copy link
Member

skvark commented Apr 13, 2018

Unfortunately I can't help. This is related to pip and wheel format. Pip checks your platform and compares it to the wheel filename (cp36-cp36m = Python 3.6 and x86_64 = 64-bit Python and manylinux1 = all GNU C Library based Linux distributions). I guess your Python has been built in some non-standard way and is not ABI compatible with cp36m. You can check supported tags with:

import pip
print(pip.pep425tags.get_supported())

It might be that you package manager has other packages for Python 3.6. You could try if they work with the wheels. More information: https://www.python.org/dev/peps/pep-0425/

@djadk84
Copy link
Author

djadk84 commented Apr 16, 2018

This is what I got when I run that command
]$ python
Python 3.6.4 (default, Apr 4 2018, 14:23:48)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.

import pip
print(pip.pep425tags.get_supported())
[('cp36', 'cp36', 'manylinux1_x86_64'), ('cp36', 'cp36', 'linux_x86_64'), ('cp36', 'abi3', 'manylinux1_x86_64'), ('cp36', 'abi3', 'linux_x86_64'), ('cp36', 'none', 'manylinux1_x86_64'), ('cp36', 'none', 'linux_x86_64'), ('cp35', 'abi3', 'manylinux1_x86_64'), ('cp35', 'abi3', 'linux_x86_64'), ('cp34', 'abi3', 'manylinux1_x86_64'), ('cp34', 'abi3', 'linux_x86_64'), ('cp33', 'abi3', 'manylinux1_x86_64'), ('cp33', 'abi3', 'linux_x86_64'), ('cp32', 'abi3', 'manylinux1_x86_64'), ('cp32', 'abi3', 'linux_x86_64'), ('py3', 'none', 'manylinux1_x86_64'), ('py3', 'none', 'linux_x86_64'), ('cp36', 'none', 'any'), ('cp3', 'none', 'any'), ('py36', 'none', 'any'), ('py3', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]

@auscompgeek
Copy link

Looking at that output, it appears that CPython was compiled with pymalloc disabled.

@djadk84 How did you install Python 3.6? This is a pretty unusual configuration for Python.

@native-api
Copy link
Contributor

Since the reason is their Python is incompatible with these prebuilt packages, this can be closed. @djadk84 can run <path/to/python> setup.py bdist_wheel to make a custom build for their Python.

@skvark skvark closed this as completed Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants