Community
cancel
Showing results for 
Search instead for 
Did you mean: 
56 Views

cannot import cv2 after job assignment

hello, please help here when I succeed to run jobs when I run my python script that I actually created from my jupyter notebook it actually gives me an error that it cannot import cv2 using python 3(intel update 2). please if someone can help

Tags (1)
0 Kudos
6 Replies
ArunJ_Intel
Moderator
56 Views

Hi Franck,

There is some lack of clarity in your question. What we could understand is that you are able to "import cv2" from your jupyter notebook but the import fails in the terminal or during job submission. Please correct us if we got this wrong.

Could you also provide us with the python path you are using in terminal as well as in jupyter notebook

You can check the python path that is being used in jupyter notebook using  the below python code.

import sys
sys.executable

To check python path used in terminal use  the below command

which python

 

 

For the python which shows the "cannot import cv2 " error you could install cv2 using the below command

pip install opencv-python


Thanks

Arun Jose
 

0 Kudos
ArunJ_Intel
Moderator
56 Views

Hi Frank,

 

Did your issue get resolved?. Please provide an update on this.

 

Arun Jose

 

 

0 Kudos
56 Views

hello this is the error i am getting after doing the above command

ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/glob/development-tools/versions/oneapi/beta05/inteloneapi/intelpython/latest/lib/python3.7/site-packages/cv2'

0 Kudos
ArunJ_Intel
Moderator
56 Views

Hey Frank,

 

This is because you are trying to install to the package to the python present in /glob.  This python is common to all devcloud users. You should be using --user flag to install the package specific only to your user 

eg

pip install opencv-python --user

Hope this helps

 

Regards

Arun Jose

0 Kudos
56 Views

thanks it worked

0 Kudos
ArunJ_Intel
Moderator
56 Views

Hey Frank,

 

We are closing this case as you have confirmed the solution provided helps. Please fell free to raise a new thread for further issues.

 

Thanks

Arun Jose

 

0 Kudos