Skip to content

python3.8: TypeError: 'type' object is not subscriptable

Summary

Hi HDEV and DMT team, I got the error "TypeError: 'type' object is not subscriptable" when I try to run python3 HdevPy/scripts/run_tests.py

Steps to reproduce

I followed the instructions on the Gitlab to compile and install everything on my Ubuntu 20.04 LTS which comes with python 3.8

Environment (please complete the following information):

  • OS: Ubuntu 20.04 LTS
  • Python Version: 3.8
  • DMT version: newest as of today
  • (pip freeze)

What is the current bug behavior?

The error shows up when I use python3.8 to run the scripts. When I use python3.9 to run the script, the problem resolved.

Relevant logs and/or screenshots

~/hdev/hdev_simulator$ python3 HdevPy/scripts/run_tests.py Traceback (most recent call last): File "HdevPy/scripts/run_tests.py", line 1, in from DMT.core import Plot File "/home/hanying/.local/lib/python3.8/site-packages/DMT/core/init.py", line 110, in from .dut_view import DutView File "/home/hanying/.local/lib/python3.8/site-packages/DMT/core/dut_view.py", line 51, in class DutView(object): File "/home/hanying/.local/lib/python3.8/site-packages/DMT/core/dut_view.py", line 581, in DutView classes_technology: List[type[Technology]] = None, TypeError: 'type' object is not subscriptable

Possible fixes

Use Python3.9.

Edited by hanhan