\documentclass{article}

\usepackage[verbose]{datatool}
\usepackage{datapie}

\DTLloaddb{fruit}{fruit.csv}

\begin{document}

\begin{figure}[htbp]
\centering
\DTLpiechart{variable=\quantity}{fruit}{\name=Name,\quantity=Quantity}
\caption{A pie chart}
\end{figure}

\end{document}
