[Tex/LaTex] LaTeX Error: File `tikz.sty’ not found

tikz-pgf

\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{atchi}
\begin{document}
\begin{tikzpicture}
\draw (-6,0)--(0,6);
\end{tikzpicture}
\end{document}

How to fix this error:

LaTeX Error: File tikz.sty not found.

Best Answer

You need to call MiKTeX Console in the apps of Windows.

Then you have to choose using user mode or admin mode (I have an admin installation, so you will see admin mode in the following ...)

After that you have to click on packages (see left red circle):

miktex console

Now type tikz where the red arrow points to.

Now click on the symbol marked with the right red circle to get a list of installable packages containing tikz in the filename.

At last click on the +-sign before tikz to install the selected packages.

Do the same with pgf:

pgf installation

Related Question