standard-azureS
Apify & Crawlee3y ago
2 replies
standard-azure

Python apify client not working inside docker container

I have built an app using streamlit that uses the python client to scrap some data. The app works correctly outside of docker, but I need to deply it using a container.
When I try to import apify_client inside the container, i get the following error:
>>> import apify_client
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/apify_client/__init__.py", line 3, in <module>
    from .client import ApifyClient, ApifyClientAsync
  File "/usr/local/lib/python3.8/dist-packages/apify_client/client.py", line 5, in <module>
    from ._http_client import _HTTPClient, _HTTPClientAsync
  File "/usr/local/lib/python3.8/dist-packages/apify_client/_http_client.py", line 16, in <module>
    from ._logging import logger_name
  File "/usr/local/lib/python3.8/dist-packages/apify_client/_logging.py", line 21, in <module>
    ctx_client_method = ContextVar[Optional[str]]('client_method', default=None)
TypeError: 'NoneType' object is not callable

Has anyone experienced something similar_?
Was this page helpful?