TypeError: 'type' object is not subscriptable
This error is observed when Python 3.8 is used instead of 3.9.
(env) C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\src>pipenv run python -m lascli fileload -h
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
'type' object is not subscriptable
Traceback (most recent call last):
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env\lib\site-packages\knack\cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env\lib\site-packages\knack\invocation.py", line 153, in execute
parsed_args = self.parser.parse_args(args)
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env\lib\site-packages\knack\parser.py", line 260, in parse_args
return super().parse_args(args)
File "C:\Python38\lib\argparse.py", line 1768, in parse_args
args, argv = self.parse_known_args(args, namespace)
File "C:\Python38\lib\argparse.py", line 1800, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File "C:\Python38\lib\argparse.py", line 1988, in _parse_known_args
positionals_end_index = consume_positionals(start_index)
File "C:\Python38\lib\argparse.py", line 1965, in consume_positionals
take_action(action, args)
File "C:\Python38\lib\argparse.py", line 1874, in take_action
action(self, namespace, argument_values, option_string)
File "C:\Python38\lib\argparse.py", line 1159, in __call__
subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
File "C:\Python38\lib\argparse.py", line 1800, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File "C:\Python38\lib\argparse.py", line 2006, in _parse_known_args
start_index = consume_optional(start_index)
File "C:\Python38\lib\argparse.py", line 1946, in consume_optional
take_action(action, args, option_string)
File "C:\Python38\lib\argparse.py", line 1874, in take_action
action(self, namespace, argument_values, option_string)
File "C:\Python38\lib\argparse.py", line 1044, in __call__
parser.print_help()
File "C:\Python38\lib\argparse.py", line 2494, in print_help
self._print_message(self.format_help(), file)
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env\lib\site-packages\knack\parser.py", line 247, in format_help
self.cli_help.show_help(self.prog.split()[0],
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env\lib\site-packages\knack\help.py", line 728, in show_help
else self.group_help_cls(self, delimiters, parser)
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env\lib\site-packages\knack\help.py", line 253, in __init__
child.load(options)
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env\lib\site-packages\knack\help.py", line 198, in load
description = getattr(options, 'description', None)
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env\lib\site-packages\knack\parser.py", line 240, in __getattribute__
self.description = self._description() \
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env\lib\site-packages\knack\commands.py", line 261, in description_loader
return extract_full_summary_from_signature(CLICommandsLoader._get_op_handler(operation))
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\env\lib\site-packages\knack\commands.py", line 274, in _get_op_handler
op = import_module(mod_to_import)
File "C:\Python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\src\lasloader\commands\file_load.py", line 5, in <module>
from lasloader.file_loader import LasParser, LocalFileLoader
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\src\lasloader\file_loader.py", line 49, in <module>
class JsonLoader:
File "C:\Users\cleong4\OneDrive - Schlumberger\OSDU\wellbore-ddms-las-loader\src\lasloader\file_loader.py", line 57, in JsonLoader
def load(self, path: str) -> dict[str, any]:
TypeError: 'type' object is not subscriptable