It seems that the opencv-pycharm 4.8.1.78 have some issues. I changed setup.py to use opencv-python==4.7.0.72 and it fixed the problem.
Traceback (most recent call last):
File "/home/jason/github_projects/ProtoRL/protorl/examples/dqn.py", line 5, in
from protorl.wrappers.common import make_env
File "/home/jason/github_projects/ProtoRL/protorl/wrappers/common.py", line 1, in
import gym
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/init.py", line 15, in
from gym.envs import make, spec, register
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/envs/init.py", line 1, in
from gym.envs.registration import load_env_plugins as _load_env_plugins
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/envs/registration.py", line 24, in
from gym.wrappers import (
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/wrappers/init.py", line 3, in
from gym.wrappers.atari_preprocessing import AtariPreprocessing
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/wrappers/atari_preprocessing.py", line 8, in
import cv2
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/init.py", line 181, in
bootstrap()
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/init.py", line 175, in bootstrap
if load_extra_py_code_for_module("cv2", submodule, DEBUG):
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/init.py", line 28, in load_extra_py_code_for_module
py_module = importlib.import_module(module_name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/typing/init.py", line 69, in
NumPyArrayGeneric = numpy.ndarray[typing.Any, numpy.dtype[numpy.generic]]
TypeError: 'numpy._DTypeMeta' object is not subscriptable
It seems that the opencv-pycharm 4.8.1.78 have some issues. I changed setup.py to use opencv-python==4.7.0.72 and it fixed the problem.
Traceback (most recent call last): File "/home/jason/github_projects/ProtoRL/protorl/examples/dqn.py", line 5, in
from protorl.wrappers.common import make_env
File "/home/jason/github_projects/ProtoRL/protorl/wrappers/common.py", line 1, in
import gym
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/init.py", line 15, in
from gym.envs import make, spec, register
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/envs/init.py", line 1, in
from gym.envs.registration import load_env_plugins as _load_env_plugins
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/envs/registration.py", line 24, in
from gym.wrappers import (
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/wrappers/init.py", line 3, in
from gym.wrappers.atari_preprocessing import AtariPreprocessing
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/wrappers/atari_preprocessing.py", line 8, in
import cv2
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/init.py", line 181, in
bootstrap()
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/init.py", line 175, in bootstrap
if load_extra_py_code_for_module("cv2", submodule, DEBUG):
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/init.py", line 28, in load_extra_py_code_for_module
py_module = importlib.import_module(module_name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/typing/init.py", line 69, in
NumPyArrayGeneric = numpy.ndarray[typing.Any, numpy.dtype[numpy.generic]]
TypeError: 'numpy._DTypeMeta' object is not subscriptable