'fastapi uvicorn No module named 'asgiref.typing'

I have created a simple fastapi application. Once I want to serve it with uvicron I got this error;

ModuleNotFoundError: No module named 'asgiref.typing'

I have installed it via conda python 3.8.12. those packages were installed

  asgiref            pkgs/main/noarch::asgiref-3.4.1-pyhd3eb1b0_0
  click              pkgs/main/noarch::click-8.0.1-pyhd3eb1b0_0
  h11                pkgs/main/noarch::h11-0.12.0-pyhd3eb1b0_0
  importlib-metadata pkgs/main/win-64::importlib-metadata-4.8.1-py38haa95532_0
  python_abi         conda-forge/win-64::python_abi-3.8-2_cp38

I have tired all possible solution without a result, any hint?



Solution 1:[1]

You should upgrade asgiref:

pip install --upgrade asgiref

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ali-T