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

前端 未结 4 1096
孤街浪徒
孤街浪徒 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:53

    There are lots of things that simply don't work at the moment, because there are either unimplemented syscalls (WSL only has partial coverage, only about 70% of syscalls are implemented, some of them only partially), or missing socket modes and options (WSL does not yet support Unix datagram sockets, although it should be available in the next insider build).

    If you go to the github (BashOnWindows) and post an strace or search for your issue and find a copy of it, that's the best way to get an answer. The Microsoft team working on this project wants lots and lots of feedback and bugtesting.

    To be clear, I am saying that you are 100% running into something that isn't implemented yet. However, there might be a way, if you look at the sourcecode for your .so file to disable the part of the code that uses that syscall (since Python is crossplatform and not all Linux syscalls are supported across all *nix operating systems).

    0 讨论(0)
  • 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 "<stdin>", line 1, in <module> 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_*
    
    0 讨论(0)
  • 2020-12-31 17:01

    I also had the same problem but I was able to fix it by just re-installing it

    $ sudo apt-get install execstack

    and the comment mentioned above in Windows 10 build 14393.479

    0 讨论(0)
  • 2020-12-31 17:09

    You can use execstack for installing opencv and even importing the lib. Yet for doing video capture, as in cv2.VideoCapture(0), bash for windows won't work. You need to have a full distribution installed.

    0 讨论(0)
提交回复
热议问题