Open torvalds-dev opened 7 months ago
torvalds.dev is analyzing the ticket
The issue you're facing is related to the aiostream
package, which is a dependency of the llama_index
package you're trying to import from. The error message indicates that there's a TypeError
when the aiostream
package tries to define a class OperatorType
with Protocol[P, T]
, where P
and T
are ParamSpecs
.
The error message Parameters to Protocol[...] must all be type variables
suggests that P
and T
are not being recognized as type variables, which is a requirement for the Protocol
generic in Python's typing module.
This could be due to a few reasons:
There might be a version mismatch between the aiostream
package and the Python interpreter you're using. The aiostream
package might not be fully compatible with Python 3.9.16, which you're using.
There might be a bug in the aiostream
package itself, which is causing this error.
The typing-extensions
package, which provides additional typing capabilities beyond those included in the standard typing
module, might not be correctly installed or might be incompatible with your Python version or the aiostream
package.
To resolve this issue, you could try the following steps:
Check the version of aiostream
you're using and see if there's a newer version available that might have fixed this issue.
Check if there are known issues related to this error in the aiostream
package's issue tracker or documentation.
Try using a different Python version. If the aiostream
package is not fully compatible with Python 3.9.16, using an older version might resolve the issue.
If none of the above steps work, you might need to contact the maintainers of the aiostream
package or the llama_index
package for further assistance.
Bug Description
Python: 3.9.16
This is the lowest level failure of importing a class from llama_index that depends on import from aiostream somwhere down the call stack. The offending line is class OperatorType(Protocol[P, T]): where P and T are ParamSpecs
I tried installing the different versions of typing-extentions but that does not change anything.
Expected behavior: imports without TypeError
Version
0.9.8.post1
Steps to Reproduce
from llama_index.query_engine import RetrieverQueryEngine
Relevant Logs/Tracbacks