运行拇指输出ImportError:没有名为cv2.cv的模块

时间:2015-04-07 21:20:42

标签: opencv amazon-web-services thumbnails thumbor

我在运行ubuntu的AWS实例上安装Thumbor(类似于here),我想使用面部检测。但是当我试图运行时

thumbor path_to_conf/thumbor.conf

我得到的只是

Traceback (most recent call last):
  File "/usr/bin/thumbor", line 9, in <module>
    load_entry_point('thumbor==4.11.1', 'console_scripts', 'thumbor')()
  File "/usr/lib64/python2.6/site-packages/thumbor/server.py", line 55, in main
    importer.import_modules()
  File "/usr/lib64/python2.6/site-packages/thumbor/importer.py", line 48, in import_modules
    self.import_item('DETECTORS', 'Detector', is_multiple=True)
  File "/usr/lib64/python2.6/site-packages/thumbor/importer.py", line 74, in import_item
    module = self.import_class('%s.%s' % (module_name, class_name))
  File "/usr/lib64/python2.6/site-packages/thumbor/importer.py", line 33, in import_class
    module = get_module and __import__(name) or __import__(module_name)
  File "/usr/lib64/python2.6/site-packages/thumbor/detectors/face_detector/__init__.py", line 11, in <module>
    from thumbor.detectors.local_detector import CascadeLoaderDetector
  File "/usr/lib64/python2.6/site-packages/thumbor/detectors/local_detector.py", line 16, in <module>
    import cv2.cv as cv
ImportError: No module named cv2.cv

显然,解决方案是安装opencv,但是在按照说明here后,我最终会用

-- The CXX compiler identification is unknown
-- The C compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Performing Test HAVE_CXX_FSIGNED_CHAR
CMake Error at /usr/share/cmake/Modules/CMakeCXXInformation.cmake:37 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:2 (PROJECT)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Failed
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found ZLIB: /usr/lib64/libz.so (found suitable version "1.2.7", minimum required is "1.2.3")

-- Found TIFF: /usr/lib64/libtiff.so (found version "4.0.3")
-- Found JPEG: /usr/lib64/libjpeg.so
-- Found WebP: /usr/lib64/libwebp.so
-- Found Jasper: /usr/lib64/libjasper.so (found version "1.900.1")
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7")
-- Found PNG: /usr/lib64/libpng.so (found version "1.2.49")
-- Looking for /usr/include/libpng/png.h
-- Looking for /usr/include/libpng/png.h - not found
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Looking for semaphore.h
-- Looking for semaphore.h - found
-- checking for module 'gtk+-3.0'
--   package 'gtk+-3.0' not found
-- checking for module 'gtk+-2.0'
--   package 'gtk+-2.0' not found
-- checking for module 'gthread-2.0'
--   package 'gthread-2.0' not found
-- checking for module 'gstreamer-base-1.0'
--   package 'gstreamer-base-1.0' not found
-- checking for module 'gstreamer-video-1.0'
--   package 'gstreamer-video-1.0' not found
-- checking for module 'gstreamer-app-1.0'
--   package 'gstreamer-app-1.0' not found
-- checking for module 'gstreamer-riff-1.0'
--   package 'gstreamer-riff-1.0' not found
-- checking for module 'gstreamer-pbutils-1.0'
--   package 'gstreamer-pbutils-1.0' not found
-- checking for module 'gstreamer-base-0.10'
--   package 'gstreamer-base-0.10' not found
-- checking for module 'gstreamer-video-0.10'
--   package 'gstreamer-video-0.10' not found
-- checking for module 'gstreamer-app-0.10'
--   package 'gstreamer-app-0.10' not found
-- checking for module 'gstreamer-riff-0.10'
--   package 'gstreamer-riff-0.10' not found
-- checking for module 'gstreamer-pbutils-0.10'
--   package 'gstreamer-pbutils-0.10' not found
-- checking for module 'libdc1394-2'
--   package 'libdc1394-2' not found
-- checking for module 'libdc1394'
--   package 'libdc1394' not found
-- checking for module 'libv4l1'
--   package 'libv4l1' not found
-- checking for module 'libv4l2'
--   package 'libv4l2' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- checking for module 'libavcodec'
--   package 'libavcodec' not found
-- checking for module 'libavformat'
--   package 'libavformat' not found
-- checking for module 'libavutil'
--   package 'libavutil' not found
-- checking for module 'libswscale'
--   package 'libswscale' not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - not found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- ICV: Downloading ippicv_linux_20141027.tgz...
-- ICV: Unpacking ippicv_linux_20141027.tgz to /etc/opencvmake/opencv/3rdparty/ippicv/unpack... -- ICV: Package successfully downloaded
-- found IPP (ICV version): 8.2.1 [8.2.1]
-- at: /etc/opencvmake/opencv/3rdparty/ippicv/unpack/ippicv_lnx
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.9", minimum required is "2.7")
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is exact version "2.7.9")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named numpy.distutils
-- Could NOT find PythonInterp: Found unsuitable version "2.6.9", but required is at least "3.4" (found /usr/bin/python)
-- Could NOT find PythonInterp: Found unsuitable version "2.6.9", but required is at least "3.2" (found /usr/bin/python)
-- Could NOT find JNI (missing:  JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
CMake Error at /usr/share/cmake/Modules/CMakeCXXInformation.cmake:37 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:3 (PROJECT)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Warning at cmake/OpenCVDetectOpenCL.cmake:27 (message):
  Can't use OpenCL
Call Stack (most recent call first):
  CMakeLists.txt:554 (include)


-- Could NOT find Matlab (missing:  MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
--
-- General configuration for OpenCV 3.0.0-dev =====================================
--   Version control:               3.0.0-beta-959-g5b3f89d
--
--   Platform:
--     Host:                        Linux 3.14.34-27.48.amzn1.x86_64 x86_64
--     CMake:                       2.8.12
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/gmake
--     Configuration:               RELEASE
--
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ Compiler:                CMAKE_CXX_COMPILER-NOTFOUND
--     C++ flags (Release):
--     C++ flags (Debug):
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -O3 -DNDEBUG
--     C flags (Debug):             -fsigned-char -g
--     Linker flags (Release):
--     Linker flags (Debug):
--     Precompiled headers:         NO
--
--   OpenCV modules:
--     To be built:                 hal core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d stitching videostab
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 androidcamera cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz
--
--   GUI:
--     QT:                          NO
--     GTK+:                        NO
--     GThread :                    NO
--     GtkGlExt:                    NO
--     OpenGL support:              NO
--     VTK support:                 NO
--
--   Media I/O:
--     ZLib:                        /usr/lib64/libz.so (ver 1.2.7)
--     JPEG:                        /usr/lib64/libjpeg.so (ver )
--     WEBP:                        /usr/lib64/libwebp.so (ver encoder: 0x0201)
--     PNG:                         /usr/lib64/libpng.so (ver 1.2.49)
--     TIFF:                        /usr/lib64/libtiff.so (ver 42 - 4.0.3)
--     JPEG 2000:                   /usr/lib64/libjasper.so (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
--     GDAL:                        NO
--
--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      NO
--       codec:                     NO
--       format:                    NO
--       util:                      NO
--       swscale:                   NO
--       gentoo-style:              NO
--     GStreamer:                   NO
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     OpenNI2:                     NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     UniCap:                      NO
--     UniCap ucil:                 NO
--     V4L/V4L2:                    NO/YES
--     XIMEA:                       NO
--     Xine:                        NO
--
--   Other third-party libraries:
--     Use IPP:                     8.2.1 [8.2.1]
--          at:                     /etc/opencvmake/opencv/3rdparty/ippicv/unpack/ippicv_lnx
--     Use IPP Async:               NO
--     Use Eigen:                   NO
--     Use TBB:                     NO
--     Use OpenMP:                  NO
--     Use GCD                      NO
--     Use Concurrency              NO
--     Use C=:                      NO
--     Use Cuda:                    NO
--     Use OpenCL:                  NO
--
--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.9)
--
--   Python 3:
--     Interpreter:                 NO
--
--   Python (for build):            /usr/bin/python2.7
--
--   Java:
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
--
--   Matlab:
--     mex:                         NO
--
--   Documentation:
--     Doxygen:                     NO
--     PlantUML:                    NO
--
--   Tests and samples:
--     Tests:                       YES
--     Performance tests:           YES
--     C/C++ Examples:              NO
--
--   Install path:                  /usr/local
--
--   cvconfig.h is in:              /etc/opencvmake/opencv/release
-- -----------------------------------------------------------------
--
-- Configuring incomplete, errors occurred!
See also "/etc/opencvmake/opencv/release/CMakeFiles/CMakeOutput.log".
See also "/etc/opencvmake/opencv/release/CMakeFiles/CMakeError.log".

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

我遇到了这个问题,由于无法解决很长一段时间,这使我发疯。但是找到解决方案真的很容易

  1. 打开命令提示符
  2. 在命令提示符下转到c:> //这样,当您打开命令提示符时,您会看到
    a
    //为此   
    a。输入“ c:\Users\<User Name> ”,然后按Enter     
    //您会注意到它不是 cd ..
    b。再次键入“ c:\Users ”,然后按Enter  
    // //您现在在 cd ..
  3. 键入c:\> ”,然后按Enter
    //这是用于Python

全部完成!