Ask Your Question
1

py-opencv import error in Bash for Windows 10

asked 2016-10-06 18:42:53 -0600

ajayramesh gravatar image

Hello,

I installed py-opencv using the following command on Bash for Windows 10:

conda install -c conda-forge opencv

I try importing cv2 in my Python3 interpreter and get the following error:

ImportError: libopencv_reg.so.3.1: cannot enable executable stack as shared object requires: Invalid argument

This works fine in regular Ubuntu but for some reason it doesn't work in Bash for Windows 10. If anyone has a work around it would be much appreciated!

edit retag flag offensive close merge delete

Comments

1

Hmm keep in mind that bash and windows 10 are still not fully functional and does not provide the same functionality as in Ubuntu. That is why installing OpenCV in Windows is done in a different manner!

StevenPuttemans gravatar imageStevenPuttemans ( 2016-10-07 04:35:21 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-12-05 20:30:46 -0600

tobyerbailey gravatar image

I have just managed to get this working. The trick was to use execstack to modify the .so files associated with opencv.

This is what I did:

  1. sudo apt-get install execstack
  2. sudo /usr/sbin/execstack -c /usr/local/lib/libopen.s i.e. modify all the opencv .so files

That seemed to do the trick for me with opencv 3.1.0

edit flag offensive delete link more

Comments

here is the actual command sudo /usr/sbin/execstack -c /usr/local/lib/libopencv_* and this works great with 3.2.0 as well

Antony gravatar imageAntony ( 2016-12-28 22:59:28 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2016-10-06 18:42:53 -0600

Seen: 2,019 times

Last updated: Dec 05 '16