Steven Moon
Steven Moon5mo ago

python old typing library?

I'm trying to get langtrace (https://github.com/Scale3-Labs/langtrace-python-sdk) running and whenever I import it I get this error. It's been 5 hours of debugging. I don't understand how to update the typing lib to > 3.8 (I think that's the issue?) Any ideas?
ExecutionErr: ExitCode: 1, last log lines:
ll/__init__.py", line 1, in <module>
from .client import *
File "/tmp/windmill/cache/pip/wmill==1.338.1/wmill/client.py", line 13, in <module>
from typing import Dict, Any, Union, Literal
File "/tmp/windmill/cache/pip/typing==3.7.4.3/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/tmp/windmill/cache/pip/typing==3.7.4.3/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Callable' has no attribute '_abc_registry'
ExecutionErr: ExitCode: 1, last log lines:
ll/__init__.py", line 1, in <module>
from .client import *
File "/tmp/windmill/cache/pip/wmill==1.338.1/wmill/client.py", line 13, in <module>
from typing import Dict, Any, Union, Literal
File "/tmp/windmill/cache/pip/typing==3.7.4.3/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/tmp/windmill/cache/pip/typing==3.7.4.3/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Callable' has no attribute '_abc_registry'
GitHub
GitHub - Scale3-Labs/langtrace-python-sdk: Langtrace SDK for Python...
Langtrace SDK for Python Applications. Contribute to Scale3-Labs/langtrace-python-sdk development by creating an account on GitHub.
10 Replies
rubenf
rubenf5mo ago
I will give it a try tomorrow so, one of the dependency here is requiring dependency 'typings' which we then install and it overrides the stdlib which it shouldn't it sounds to me like there is a faulty dependency there that should not try to declare typings as a dependency for python > 3.7 but there may be ways of catching that in windmill
Steven Moon
Steven Moon5mo ago
awesome, that's what i was thinking as well and communicated my suspicion to the langtrace team yesterday. They are planning to update their lib to support windmill and get some stuff in the hub.
rubenf
rubenf5mo ago
oh that's pretty nice but I think the dependency is not coming from them though
Steven Moon
Steven Moon5mo ago
right, but it's being brought in by one of their dependencies because as soon as I include it in a script it fails.
rubenf
rubenf5mo ago
yes it's one of those:
'trace-attributes>=4.0.2',
'opentelemetry-api',
'opentelemetry-sdk',
'opentelemetry-instrumentation',
'pinecone-client',
'tiktoken',
'opentelemetry-exporter-otlp-proto-http>=1.24.0',
'opentelemetry-exporter-otlp-proto-grpc>=1.24.0',
'weaviate-client',
'trace-attributes>=4.0.2',
'opentelemetry-api',
'opentelemetry-sdk',
'opentelemetry-instrumentation',
'pinecone-client',
'tiktoken',
'opentelemetry-exporter-otlp-proto-http>=1.24.0',
'opentelemetry-exporter-otlp-proto-grpc>=1.24.0',
'weaviate-client',
so if you can find which one, you may be able to fix it upstream btw we use pip-compile so you might be able to trace it there where it's coming from I believe it can show the full tree
Steven Moon
Steven Moon5mo ago
perfect, thanks
rubenf
rubenf5mo ago
found it
typing==3.7.4.3
# via trace-attributes
typing==3.7.4.3
# via trace-attributes
rubenf
rubenf5mo ago
GitHub
langtrace-trace-attributes/requirements.txt at main · Scale3-Labs/l...
Trace Attributes for Langtrace. Contribute to Scale3-Labs/langtrace-trace-attributes development by creating an account on GitHub.
rubenf
rubenf5mo ago
which seems wrong so I would say, they probably need to fix it from source
Steven Moon
Steven Moon5mo ago
agreed - that is one monster requirements file for a project that only uses these imports:
from __future__ import annotations
from typing import Optional
from pydantic import BaseModel, Extra, Field

from setuptools import find_packages, setup
from __future__ import annotations
from typing import Optional
from pydantic import BaseModel, Extra, Field

from setuptools import find_packages, setup
working with them to get this fixed. @rubenf Thanks for your help!