title: FastAPI: ModuleNotFoundError: No module named 'uvicorn'
body: <p>I will admit I never used <code>gunicorn</code> before. When I run the command <code>gunicorn  main:app -k uvicorn.workers.UvicornWorker</code> gives error:</p>
  <pre><code>Error: class uri 'uvicorn.workers.UvicornWorker' invalid or not found: 
  
  [Traceback (most recent call last):
    File &quot;/Users/AdnanAhmad/Data/anaconda3/lib/python3.7/site-packages/gunicorn/util.py&quot;, line 135, in load_class
      mod = import_module('.'.join(components))
    File &quot;/Users/X/Data/anaconda3/lib/python3.7/importlib/__init__.py&quot;, line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006, in _gcd_import
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 983, in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 953, in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006, in _gcd_import
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 983, in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 965, in _find_and_load_unlocked
  ModuleNotFoundError: No module named 'uvicorn'
  </code></pre>