openCV can't use np.ones or np.zores()

I am sure I have installed cv2 and numpy, but it still can’t work

import cv2
import numpy as np

a = cv2.imread(“D:\OpenCV\test.png”)
b = np.ones((10,10,3))

b = a[100:200,300:350]

cv2.imshow(“original”,a)
cv2.imshow(“change”,b)
cv2.waitKey()
cv2.destroyAllWindows()

could it be that you have a DAT in your network called ‘numpy’ as well? it seems that its looking for ‘/project1/numpy’. Btw, numpy is by default included, so you dont need to import it.

cheers,
tim

Thank you timgerritsen,it can work when I created a containter and rename to numpy, btw why can remove to import numpy? you can see I need use np.onse or np.zores, if I don’t import numpy as np, the np will be not definited, so how about you?

You’re right, you need to import numpy indeed. My mistake sorry :slight_smile:

Cheers,
tim

how about pygame? I can’t import it