Reading time: 2 minutes
You must have Ubuntu installed on Windows and a project created in Visual Studio Code beforehand. Here are the following helpful links:
Create project in Visual Studio using commands in Ubuntu
In the Visual Studio Code terminal, install Python3 as shown below:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/12/image-13.png?resize=545%2C33&ssl=1)
sudo apt install python3-pip
To check the installed Python version, use the following command:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/12/image-14.png?resize=461%2C29&ssl=1)
sudo pip3 --version
Install uvicorn with minimal pure dependencies for Python:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/12/image-15.png?resize=595%2C32&ssl=1)
sudo pip install uvicorn[standard]
Create a .py file to perform a small test and see if it works:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/12/image-19.png?resize=629%2C147&ssl=1)
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/12/image-26.png?resize=743%2C320&ssl=1)
from fastapi import FastAPI
devCodeLight = FastAPI()
@devCodeLight.get("/")
async def get_prueba():
return [{"prueba": "devCodeLight"}]
To run it, enter the following in the terminal:
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/12/image-24.png?resize=613%2C117&ssl=1)
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/12/image-25.png?resize=716%2C106&ssl=1)
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2022/12/image-27.png?resize=321%2C259&ssl=1)
I hope this helps. Have a great day!
![](https://i0.wp.com/devcodelight.com/wp-content/uploads/2023/07/cropped-light_logo-5.png?resize=100%2C100&ssl=1)