pythonpython-3.xasgiuvicorn

uvicorn is not working when called from the terminal


I tried installing uvicorn on the system via pip3 which worked, however i am unable to run the same from the command line. Any pointers as to how to resolve this?

Requirement already satisfied: uvicorn in /home/vhawk19/.local/lib/python3.7/site-packages (0.10.8)
Requirement already satisfied: uvloop>=0.14.0; sys_platform != "win32" and sys_platform != "cygwin" and platform_py
thon_implementation != "pypy" in /home/vhawk19/.local/lib/python3.7/site-packages (from uvicorn) (0.14.0)
Requirement already satisfied: websockets==8.* in /home/vhawk19/.local/lib/python3.7/site-packages (from uvicorn)
(8.1)
Requirement already satisfied: click==7.* in /home/vhawk19/.local/lib/python3.7/site-packages (from uvicorn) (7.0
)
Requirement already satisfied: h11==0.8.* in /home/vhawk19/.local/lib/python3.7/site-packages (from uvicorn) (0.8
.1)
Requirement already satisfied: httptools==0.0.13; sys_platform != "win32" and sys_platform != "cygwin" and platform
_python_implementation != "pypy" in /home/vhawk19/.local/lib/python3.7/site-packages (from uvicorn) (0.0.13)
vhawk19@api-server:~/api-server$ uvicorn
-bash: uvicorn: command not found```

Solution

  • Check your PATH environment variable. It should include the path to unicorn package too.

    Not sure about the linux paths, but in windows you need to have these two in your Path environment variable.

    D:\Programme\Python\Python37
    D:\Programme\Python\Python37\Scripts