kengz/SLM-Lab

ModuleNotFoundError: No module named 'cv2'

Closed this issue · 4 comments

When I want to run SLM lab commands according to Page 193 in Chinese version, there is an error information as follows:

(lab) myhost@luckywlj:~/SLM-Lab$ python run_lab.py slm_lab/spec/benchmark/a2c/a2c_nstep_pong.json a2c_ntep_pong search
Traceback (most recent call last):
File "run_lab.py", line 4, in
from slm_lab.experiment import search
File "/home/luckywlj/SLM-Lab/slm_lab/experiment/search.py", line 2, in
from slm_lab.lib import logger, util
File "/home/luckywlj/SLM-Lab/slm_lab/lib/logger.py", line 1, in
from slm_lab.lib import util
File "/home/luckywlj/SLM-Lab/slm_lab/lib/util.py", line 7, in
import cv2
ModuleNotFoundError: No module named 'cv2'

I don't know what is the cv2 package, so I try to "pip3 install cv2" and failed. Could you please tell me how to solve the problem? thank you !

kengz commented

Hi it's likely that your environment setup failed halfway. Could you show the output from:

conda activate lab
conda list
kengz commented

yep it's missing a lot of dependencies. Could you run this from the SLM Lab folder: conda env update -f environment.yml
That should set things up. Then you should be able to use it.

yep it's missing a lot of dependencies. Could you run this from the SLM Lab folder: conda env update -f environment.yml That should set things up. Then you should be able to use it.

thank you so much! I try it now.