Python3.4 error - Cannot enable executable stack as shared object requires: Invalid argument

前端 未结 4 1101
孤街浪徒
孤街浪徒 2020-12-31 16:36

I\'ve been trying to install OpenCV in a Bash on Windows (Windows Subsystem for Linux, wsl) environment and it\'s been proving very difficult.

I think I\'m getting v

4条回答
  •  遥遥无期
    2020-12-31 16:59

    I solved this problem following this:tatsuya-y.hatenablog.com

    I use windows bash and install opencv by conda install -c menpo opencv3=3.1.0 then I got this (python 2.7) >>>import cv2 Traceback (most recent call last): File "", line 1, in ImportError: libopencv_ccalib.so.3.1: cannot enable executable stack as shared object requires: Invalid argument

    I solve it by execstackcommand

    sudo apt-get install execstack
    sudo execstack -c $HOME/anaconda2/lib/libopencv_*
    

    Then sudo apt-get install gtk2.0-0 Problem solved! >>> cv2.__version__ '3.1.0'

    Remember that the opencv libraries are installed to /usr/local/lib if following the installation instructions online. Thus, the command would be:

    sudo execstack -c /usr/local/lib/libopencv_*
    

提交回复
热议问题