In [1]:
import sys
print(sys.version)
#this needs to be python2!!
#if it is not 'sudo gedit /usr/local/share/jupyter/kernels/python2/kernel.json' and explicitly change argv to python2


2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609]

In [2]:
#perhaps enforce using the plain ubuntu install, instead of the ros install of opencv
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')

In [3]:
import cv2
import numpy as np

In [5]:
cap = cv2.VideoCapture(0)

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()

    # Our operations on the frame come here
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    # Display the resulting frame
    cv2.imshow('frame',gray)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()


---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-5-8bff37fb5508> in <module>()
      3 while(True):
      4     # Capture frame-by-frame
----> 5     ret, frame = cap.read()
      6 
      7     # Our operations on the frame come here

KeyboardInterrupt: 

In [ ]:
import ../../rai/rai/libry as ry

In [5]:
import sys
sys.path.append('../../rai/rai/ry')
import libry as ry


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-5-042540052fdd> in <module>()
      1 import sys
      2 sys.path.append('../../rai/rai/ry')
----> 3 import libry as ry

ImportError: dynamic module does not define init function (initlibry)

In [ ]: