- Clone the repository
git clone https://github.com/Evolutionary-Algorithms-On-Click/evolve-backend-python
-
Go to the backend directory
-
Create a virtual environment
python -m venv venv
- Activate the virtual environment
macOS / Linux
source venv/bin/activate
windows
.\venv\Scripts\activate
Note
To deactivate the virtual environment run
deactivate
- Install the dependencies
macOS and Linux
pip install -r requirements.txt
Windows
Important
uvloop
library is not needed in Windows, It can be removed fromrequirements.txt
.pygraphviz
has some problems with windows so, Refer for instructions.
- Install Visual C/C++ from here.
- Download and install Graphviz for Windows 10 (64-bit).
- Install PyGraphviz via
python -m pip install --config-settings="--global-option=build_ext" --config-settings="--global-option=-IC:\Program Files\Graphviz\include" --config-settings="--global-option=-LC:\Program Files\Graphviz\lib" pygraphviz
Update the requirements
pip freeze > requirements.txt
- Start the FastAPI app
uvicorn main:app --reload
- To run in production.
In Windows.
uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4
In Linux.
gunicorn main:app -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000 -w 4