# Error: TexStudio “Could not start command”

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?

-
I'm having this error with TeXLive also. It happens when the editor does not find the bin files. You can do this: go to Options>Configure and insert the whole path for the pdflatex. If you use windows, look for C:\PROGRA~2\MIKTEX~2.9\miktex\bin\pdflatex.exe or something similar. –  Sigur Jan 23 '13 at 18:38
Also the discussion here sourceforge.net/p/texstudio/discussion/907839/thread/6363740c –  Sigur Jan 23 '13 at 18:40
Hi Sigur, in Options>Configure>Build>Default Compiler I have inserted the path C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe but still doesn't work. –  user24846 Jan 23 '13 at 18:55
Try to use double quotes and the extension, but not on default compiler, try it on the other field (commands>pdflatex) "C:\....exe" %.tex –  Sigur Jan 23 '13 at 18:58
This works, thanks a lot! –  user24846 Jan 23 '13 at 19:22

Open TeXstudio and go to the Options menu.

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

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 to it. Then write %.tex to denote the current tex file.

In resume, 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.

-

I was facing similar problem while migrating to TexStudio for editing the latex files (I previously used WinEdt). The problem got solved when I realized that I have installed MikTex in two separate locations of my workstation. The environment path variables were set correctly too. Solution: I uninstalled all previous version of Miktex and TexStudio; and installled a single version of both in my workstation. It works fine now. The configuration settings in TexStudio is as follows:

-