Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
827 Discussions

cannot import cv2 after job assignment

Tchouanga__Franck
221 Views

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

0 Kudos
6 Replies
ArunJ_Intel
Moderator
221 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
 

ArunJ_Intel
Moderator
221 Views

Hi Frank,

 

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

 

Arun Jose

 

 

Tchouanga__Franck
221 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'

ArunJ_Intel
Moderator
221 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

Tchouanga__Franck
221 Views

thanks it worked

ArunJ_Intel
Moderator
221 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

 

Reply