TypeError: Plain typing.TypeAlias is not valid as type argument #394

Closed
opened 2026-02-16 00:17:43 -05:00 by yindo · 2 comments
Owner

Originally created by @chaoStart on GitHub (Dec 30, 2024).

llama-parse --help

llama-parse --help

##First, I use" pip install -U llama-index --upgrade --no-cache-dir --force-reinstall",
##then,I use "pip install llama-parse",
##but,when I test “llama-parse --help” script,it's error.

(llamaParse) (base) bqc@sciyon-LEGION-REN9000K-34IRZ:~/project/pdfMinerU$ llama-parse --help
Traceback (most recent call last):
File "/home/bqc/.conda/envs/llamaParse/bin/llama-parse", line 5, in
from llama_parse.cli.main import parse
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_parse/__init__.py", line 1, in
from llama_parse.base import LlamaParse, ResultType
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_parse/base.py", line 14, in
from llama_index.core.async_utils import asyncio_run, run_jobs
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/__init__.py", line 25, in
from llama_index.core.indices import (
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/__init__.py", line 32, in
from llama_index.core.indices.loading import (
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/loading.py", line 6, in
from llama_index.core.indices.registry import INDEX_STRUCT_TYPE_TO_INDEX_CLASS
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/registry.py", line 13, in
from llama_index.core.indices.property_graph import PropertyGraphIndex
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/property_graph/__init__.py", line 1, in
from llama_index.core.indices.property_graph.base import PropertyGraphIndex
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/property_graph/base.py", line 17, in
from llama_index.core.indices.property_graph.transformations import (
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/property_graph/transformations/__init__.py", line 4, in
from llama_index.core.indices.property_graph.transformations.schema_llm import (
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/property_graph/transformations/schema_llm.py", line 95, in
class SchemaLLMPathExtractor(TransformComponent):
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/property_graph/transformations/schema_llm.py", line 141, in SchemaLLMPathExtractor
possible_entities: Optional[TypeAlias] = None,
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/typing.py", line 309, in inner
return func(*args, **kwds)
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/typing.py", line 400, in getitem
return self._getitem(self, parameters)
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/typing.py", line 525, in Optional
arg = _type_check(parameters, f"{self} requires a single type.")
File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/typing.py", line 169, in _type_check
raise TypeError(f"Plain {arg} is not valid as type argument")
TypeError: Plain typing.TypeAlias is not valid as type argument

Originally created by @chaoStart on GitHub (Dec 30, 2024). llama-parse --help ## llama-parse --help ##First, I use" pip install -U llama-index --upgrade --no-cache-dir --force-reinstall", ##then,I use "pip install llama-parse", ##but,when I test “llama-parse --help” script,it's error. (llamaParse) (base) bqc@sciyon-LEGION-REN9000K-34IRZ:~/project/pdfMinerU$ llama-parse --help Traceback (most recent call last): File "/home/bqc/.conda/envs/llamaParse/bin/llama-parse", line 5, in <module> from llama_parse.cli.main import parse File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_parse/__init__.py", line 1, in <module> from llama_parse.base import LlamaParse, ResultType File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_parse/base.py", line 14, in <module> from llama_index.core.async_utils import asyncio_run, run_jobs File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/__init__.py", line 25, in <module> from llama_index.core.indices import ( File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/__init__.py", line 32, in <module> from llama_index.core.indices.loading import ( File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/loading.py", line 6, in <module> from llama_index.core.indices.registry import INDEX_STRUCT_TYPE_TO_INDEX_CLASS File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/registry.py", line 13, in <module> from llama_index.core.indices.property_graph import PropertyGraphIndex File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/property_graph/__init__.py", line 1, in <module> from llama_index.core.indices.property_graph.base import PropertyGraphIndex File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/property_graph/base.py", line 17, in <module> from llama_index.core.indices.property_graph.transformations import ( File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/property_graph/transformations/__init__.py", line 4, in <module> from llama_index.core.indices.property_graph.transformations.schema_llm import ( File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/property_graph/transformations/schema_llm.py", line 95, in <module> class SchemaLLMPathExtractor(TransformComponent): File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/site-packages/llama_index/core/indices/property_graph/transformations/schema_llm.py", line 141, in SchemaLLMPathExtractor possible_entities: Optional[TypeAlias] = None, File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/typing.py", line 309, in inner return func(*args, **kwds) File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/typing.py", line 400, in __getitem__ return self._getitem(self, parameters) File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/typing.py", line 525, in Optional arg = _type_check(parameters, f"{self} requires a single type.") File "/home/bqc/.conda/envs/llamaParse/lib/python3.10/typing.py", line 169, in _type_check raise TypeError(f"Plain {arg} is not valid as type argument") TypeError: Plain typing.TypeAlias is not valid as type argument
yindo added the bug label 2026-02-16 00:17:43 -05:00
yindo closed this issue 2026-02-16 00:17:43 -05:00
Author
Owner

@logan-markewich commented on GitHub (Dec 30, 2024):

Hmm, i've seen this a few times. This isn't a llama-parse issue, its a llama-index issue. I think it has something to do with either your python version or maybe your typing-extensions version? I'm not really sure. I could not reproduce

python=3.10.12
typing-extensions=4.12.2
@logan-markewich commented on GitHub (Dec 30, 2024): Hmm, i've seen this a few times. This isn't a llama-parse issue, its a llama-index issue. I think it has something to do with either your python version or maybe your `typing-extensions` version? I'm not really sure. I could not reproduce ``` python=3.10.12 typing-extensions=4.12.2 ```
Author
Owner

@logan-markewich commented on GitHub (Dec 30, 2024):

llama-index-core==0.12.9 should fix this rare issue

@logan-markewich commented on GitHub (Dec 30, 2024): `llama-index-core==0.12.9` should fix this rare issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#394