[Tex/LaTex] Error: TexStudio “Could not start command”

installingmiktextexstudio

I just installed TeXstudio 2.5.2 and compiled the following

\documentclass{article}
\begin{document}
\end{document}

but I get this error

Error: Could not start the command: "/usr/texbin/pdflatex" -synctex=1 -interaction=nonstopmode "texstudio_qH5268".tex

I already installed MiKTeX, so why do I get this error?

Best Answer

Open TeXstudio and go to the Options menu.

enter image description here

Then Configure TeXstudio. On the left panel choose the second item Commands.

enter image description here

On the pdflatex field, fill it with the full path for your pdflatex.exe. For example, in Windows with MiKTeX, something similar to

C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe 

Don't forget to use double quotes with it. Then write %.tex to denote the current tex file.

In summary, you'll have something like this (ignoring highlights):

"C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" %.tex

You can do the same to other tools, like dvips for example.