PhysioLabXR / PhysioLabXR-Community

GNU General Public License v3.0
31 stars 13 forks source link

installation issue numpy._DTypeMeta is not subscriptable when import cv2 #119

Closed lucask07 closed 1 year ago

lucask07 commented 1 year ago

System python is 3.9.7

Python 3.9.7 (default, Sep 16 2021, 08:50:36) 
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
A00080338:physiolabxr koer2434$ physiolabxr
AppConfigs: current working directory is changed to /Users/koer2434/opt/anaconda3/lib/python3.9/site-packages
Traceback (most recent call last):
  File "/Users/koer2434/opt/anaconda3/bin/physiolabxr", line 8, in <module>
    sys.exit(physiolabxr())
  File "/Users/koer2434/opt/anaconda3/lib/python3.9/site-packages/physiolabxr/__init__.py", line 14, in physiolabxr
    AppConfigs(_reset=False)  # create the singleton app configs object
  File "/Users/koer2434/opt/anaconda3/lib/python3.9/site-packages/physiolabxr/utils/Singleton.py", line 11, in __call__
    cls._instances[cls] = super().__call__(*args, **kwargs)
  File "<string>", line 18, in __init__
  File "/Users/koer2434/opt/anaconda3/lib/python3.9/site-packages/physiolabxr/configs/configs.py", line 153, in __post_init__
    import pyscreeze
  File "/Users/koer2434/opt/anaconda3/lib/python3.9/site-packages/pyscreeze/__init__.py", line 25, in <module>
    import cv2
  File "/Users/koer2434/opt/anaconda3/lib/python3.9/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/Users/koer2434/opt/anaconda3/lib/python3.9/site-packages/cv2/__init__.py", line 175, in bootstrap
    if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
  File "/Users/koer2434/opt/anaconda3/lib/python3.9/site-packages/cv2/__init__.py", line 28, in __load_extra_py_code_for_module
    py_module = importlib.import_module(module_name)
  File "/Users/koer2434/opt/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/koer2434/opt/anaconda3/lib/python3.9/site-packages/cv2/typing/__init__.py", line 69, in <module>
    NumPyArrayGeneric = numpy.ndarray[typing.Any, numpy.dtype[numpy.generic]]
TypeError: 'numpy._DTypeMeta' object is not subscriptable

If I upgrade numpy to 1.26.1 this error goes away.

HaowenWeiJohn commented 1 year ago

Hi @lucask07,

Thank you for bringing this issue to our attention. The problem is caused by the dependency installation sequence. In the previous dependency settings, numpy >= 1.26.0 was installed first, but scipy ~= 1.9.1 would downgrade numpy to numpy < 1.25.0, >= 1.18.5.

To resolve this conflict, we have updated our requirements as follows:

We appreciate your attention to detail. If you have any further concerns or suggestions, please don't hesitate to let us know.

You can find more details about the update in this issue: #118

Best regards, Haowen 'John' Wei & PhysioLabXR Team"

ApocalyVec commented 1 year ago

@lucask07 has this been resolve as per @HaowenWeiJohn 's update? We can close the issue if it did.

lucask07 commented 1 year ago

Hi @ApocalyVec Sounds good. Sorry, I don't have time to test this. If it works on your end then go ahead and close this issue.

HaowenWeiJohn commented 1 year ago

@lucask07 @ApocalyVec Issue closed. Thank you very much.