如何修复“抱歉,但 C:\...\miktex-pdftex.exe 未成功。”错误?

如何修复“抱歉,但 C:\...\miktex-pdftex.exe 未成功。”错误?

我刚刚安装了 MikTex 2.9 并尝试制作一个简单的表格:

\documentclass{article}

\begin{document}

\begin{table}[h!]
  \begin{center}
    \caption{Caption for the table.}
    \label{tab:table1}
    \begin{tabular}{l|c||r}
      1 & 2 & 3\\
      \hline
      a & b & c\\
    \end{tabular}
  \end{center}
\end{table}

\end{document}

但收到此消息:

You may want to visit the MiKTeX project page (http://miktex.org), if you
need help.

Sorry, but C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\miktex-pdftex.exe did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:/Users/Solarmew/AppData/Local/MiKTeX/2.9/miktex/log/miktex-pdftex.log

You may want to visit the MiKTeX project page (http://miktex.org), if you
need help.

首先我尝试了解决方案这里(打开包管理器(管理员),使用存储库->同步),它没有给我同样的错误,但这次它说forest.sty not found,所以我去了这里并按照建议更改了软件包存储库,方法是选中“软件包应从互联网安装”。现在我又遇到了第一个错误,而且它不会消失 :(

这是日志:

2015-09-12 19:38:41,935-0400 INFO  miktex-pdftex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-09-12 19:38:41,985-0400 FATAL miktex-pdftex - The operation failed for some reason.
2015-09-12 19:38:41,985-0400 FATAL miktex-pdftex - Info: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe
2015-09-12 19:38:41,985-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\Process.cpp
2015-09-12 19:38:41,985-0400 FATAL miktex-pdftex - Line: 290
2015-09-12 19:39:28,578-0400 INFO  miktex-pdftex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-09-12 19:39:28,630-0400 FATAL miktex-pdftex - The operation failed for some reason.
2015-09-12 19:39:28,630-0400 FATAL miktex-pdftex - Info: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe
2015-09-12 19:39:28,630-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\Process.cpp
2015-09-12 19:39:28,630-0400 FATAL miktex-pdftex - Line: 290
2015-09-12 19:41:23,134-0400 INFO  miktex-pdftex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-09-12 19:41:23,183-0400 FATAL miktex-pdftex - The operation failed for some reason.
2015-09-12 19:41:23,184-0400 FATAL miktex-pdftex - Info: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe
2015-09-12 19:41:23,184-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\Process.cpp
2015-09-12 19:41:23,184-0400 FATAL miktex-pdftex - Line: 290
2015-09-12 19:47:23,559-0400 INFO  miktex-pdftex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-09-12 19:47:23,612-0400 FATAL miktex-pdftex - The operation failed for some reason.
2015-09-12 19:47:23,612-0400 FATAL miktex-pdftex - Info: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe
2015-09-12 19:47:23,612-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\Process.cpp
2015-09-12 19:47:23,612-0400 FATAL miktex-pdftex - Line: 290
2015-09-12 19:47:28,535-0400 INFO  miktex-pdftex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-09-12 19:47:28,588-0400 FATAL miktex-pdftex - The operation failed for some reason.
2015-09-12 19:47:28,588-0400 FATAL miktex-pdftex - Info: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe
2015-09-12 19:47:28,588-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\Process.cpp
2015-09-12 19:47:28,588-0400 FATAL miktex-pdftex - Line: 290
2015-09-12 19:55:27,809-0400 INFO  miktex-pdftex - installing package pgf triggered by tex\latex\pgf\frontendlayer\tikz.sty
2015-09-12 19:55:28,190-0400 INFO  miktex-pdftex - mpm: starting package maintenance...
2015-09-12 19:55:28,190-0400 INFO  miktex-pdftex - mpm: installation directory: "C:\Program Files (x86)\MiKTeX 2.9"
2015-09-12 19:55:28,190-0400 INFO  miktex-pdftex - mpm: package repository: http://mirror.jmu.edu/pub/CTAN/systems/win32/miktex/tm/packages/
2015-09-12 19:55:28,433-0400 INFO  miktex-pdftex - mpm: lightweight database digest: fd7a40a42ed2f1e70be3b6bdb1baccf2
2015-09-12 19:55:28,434-0400 INFO  miktex-pdftex - mpm: going to download 9467103 bytes
2015-09-12 19:55:28,434-0400 INFO  miktex-pdftex - mpm: going to install 658 file(s) (1 package(s))
2015-09-12 19:55:28,435-0400 INFO  miktex-pdftex - mpm: downloading http://mirror.jmu.edu/pub/CTAN/systems/win32/miktex/tm/packages/pgf.tar.lzma...
2015-09-12 19:55:42,770-0400 INFO  miktex-pdftex - mpm: 10594095 bytes, 722.22 KB/Sec
2015-09-12 19:55:42,798-0400 INFO  miktex-pdftex - mpm: visiting repository http://mirror.jmu.edu/pub/CTAN/systems/win32/miktex/tm/packages/...
2015-09-12 19:55:42,798-0400 INFO  miktex-pdftex - mpm: repository type: remote package repository
2015-09-12 19:55:42,798-0400 INFO  miktex-pdftex - mpm: loading lightweight database...
2015-09-12 19:55:42,799-0400 INFO  miktex-pdftex - mpm: downloading http://mirror.jmu.edu/pub/CTAN/systems/win32/miktex/tm/packages/miktex-zzdb1-2.9.tar.lzma...
2015-09-12 19:55:43,053-0400 INFO  miktex-pdftex - mpm: 157260 bytes, 604.62 KB/Sec
2015-09-12 19:55:43,249-0400 INFO  miktex-pdftex - mpm: lightweight database digest: effaaa46816771ed79be6c0905c3d630
2015-09-12 19:55:43,275-0400 INFO  miktex-pdftex - mpm: extracting files from pgf.tar.lzma...
2015-09-12 19:55:43,834-0400 FATAL miktex-pdftex - Windows API error 87: The parameter is incorrect.

2015-09-12 19:55:43,834-0400 FATAL miktex-pdftex - Info: C:\ProgramData\MiKTeX\2.9\miktex/data/le\b1cfc6be702f63eea92ca0fbc9559e5c.fndb
2015-09-12 19:55:43,834-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\win\winMemoryMappedFile.cpp
2015-09-12 19:55:43,834-0400 FATAL miktex-pdftex - Line: 120
2015-09-12 19:56:33,540-0400 INFO  miktex-pdftex - installing package standalone triggered by tex\latex\standalone\standalone.cls
2015-09-12 19:56:33,903-0400 INFO  miktex-pdftex - mpm: starting package maintenance...
2015-09-12 19:56:33,904-0400 INFO  miktex-pdftex - mpm: installation directory: "C:\Program Files (x86)\MiKTeX 2.9"
2015-09-12 19:56:33,904-0400 INFO  miktex-pdftex - mpm: package repository: http://mirror.jmu.edu/pub/CTAN/systems/win32/miktex/tm/packages/
2015-09-12 19:56:34,071-0400 INFO  miktex-pdftex - mpm: lightweight database digest: effaaa46816771ed79be6c0905c3d630
2015-09-12 19:56:34,071-0400 INFO  miktex-pdftex - mpm: going to download 314852 bytes
2015-09-12 19:56:34,071-0400 INFO  miktex-pdftex - mpm: going to install 8 file(s) (1 package(s))
2015-09-12 19:56:34,072-0400 INFO  miktex-pdftex - mpm: downloading http://mirror.jmu.edu/pub/CTAN/systems/win32/miktex/tm/packages/standalone.tar.lzma...
2015-09-12 19:56:34,856-0400 INFO  miktex-pdftex - mpm: 314852 bytes, 393.69 KB/Sec
2015-09-12 19:56:34,858-0400 INFO  miktex-pdftex - mpm: extracting files from standalone.tar.lzma...
2015-09-12 19:56:34,887-0400 FATAL miktex-pdftex - Windows API error 87: The parameter is incorrect.

2015-09-12 19:56:34,887-0400 FATAL miktex-pdftex - Info: C:\ProgramData\MiKTeX\2.9\miktex/data/le\b1cfc6be702f63eea92ca0fbc9559e5c.fndb
2015-09-12 19:56:34,887-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\win\winMemoryMappedFile.cpp
2015-09-12 19:56:34,887-0400 FATAL miktex-pdftex - Line: 120
2015-09-12 20:02:10,783-0400 INFO  miktex-pdftex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-09-12 20:02:11,019-0400 FATAL miktex-pdftex - The operation failed for some reason.
2015-09-12 20:02:11,020-0400 FATAL miktex-pdftex - Info: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe
2015-09-12 20:02:11,020-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\Process.cpp
2015-09-12 20:02:11,020-0400 FATAL miktex-pdftex - Line: 290
2015-09-12 20:03:12,810-0400 INFO  miktex-pdftex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-09-12 20:03:13,031-0400 FATAL miktex-pdftex - The operation failed for some reason.
2015-09-12 20:03:13,032-0400 FATAL miktex-pdftex - Info: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe
2015-09-12 20:03:13,032-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\Process.cpp
2015-09-12 20:03:13,032-0400 FATAL miktex-pdftex - Line: 290
2015-09-12 20:06:53,271-0400 INFO  miktex-pdftex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-09-12 20:06:53,497-0400 FATAL miktex-pdftex - The operation failed for some reason.
2015-09-12 20:06:53,498-0400 FATAL miktex-pdftex - Info: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe
2015-09-12 20:06:53,498-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\Process.cpp
2015-09-12 20:06:53,498-0400 FATAL miktex-pdftex - Line: 290
2015-09-12 20:08:00,190-0400 INFO  miktex-pdftex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-09-12 20:08:00,412-0400 FATAL miktex-pdftex - The operation failed for some reason.
2015-09-12 20:08:00,412-0400 FATAL miktex-pdftex - Info: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe
2015-09-12 20:08:00,412-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\Process.cpp
2015-09-12 20:08:00,413-0400 FATAL miktex-pdftex - Line: 290

答案1

问题出在安装上,而不是更新软件包上。我今天在 Windows 10 上安装 MiKTeX 2.9.5721 时也遇到了同样的错误。

2015-09-12 20:08:00,190-0400 INFO miktex-pdftex - 运行“initexmf --quiet --update-fndb”以刷新文件名数据库 2015-09-12 20:08:00,412-0400 FATAL miktex-pdftex - 操作由于某种原因失败。 2015-09-12 20:08:00,412-0400 FATAL miktex-pdftex - 信息:C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe 2015-09-12 20:08:00,412-0400 FATAL miktex-pdftex - 来源:Libraries\MiKTeX\Core\Process.cpp 2015-09-12 20:08:00,413-0400 FATAL miktex-pdftex - 行:290

在尝试了几次修复后线,这对我有用。我认为首先,C:/Program Files (x86) 中的权限存在问题,您可以通过直接在 C:/ 上创建文件来修复此问题。其次(对我来说,可能对您来说不是),我认为另一个程序尝试使用其中一个 pdf map dl 文件(?)时出现了问题,这已在文中提及这里. 解决此问题的方法:

  1. 卸载了我之前的 MiKTeX2.9 版本
  2. 卸载 Adob​​e Reader
  3. 重新安装 Adob​​e Reader
  4. 重启
  5. 将 MiKTeX 下载移至桌面上的文件夹
  6. 创建了一个文件夹 C:/MiKTeX 2.9
  7. 运行安装向导并以单个用户身份安装到我的新文件夹。(我从未让系统安装工作。)
  8. 向导完成后,立即运行 MiKTeX 更新向导。我选择仅更新 miktex-texworks-bin。(如果我在尝试对文档进行 TeX 处理之前没有运行更新,则什么都不起作用。)

您也许可以不弄乱您的 PDF 查看器安装,但一定要尝试创建除 Program Files (x86) 之外的文件夹。

答案2

当您插入图片并且图片路径中包含特殊符号(例如变音符号 (ä,ü,ö))时,也会出现该错误。因此,请确保您的图片路径中不包含任何此类符号。

答案3

我遇到过同样的问题,此解决方案无需重新安装 MikTeX 即可解决问题。只需搜索MikTex Update (Admin)并更新所有可更新的软件包。第一次选择全部按钮呈灰色。继续进行预选更新并完成。然后再次更新,这次选择全部。诀窍是运行 的管理员版本MikTex Update。就是这样!

答案4

我遇到了同样的问题,并查看了日志。它说这个命令失败了:

C:\Program Files\MiKTeX 2.9\miktex\bin\x64>initexmf.exe --mklinks --mkmaps

我以管理员模式打开命令提示符并执行它,现在 pdflatex 可以正常工作了。我首先尝试在非管理员窗口中执行它,但由于权限问题而失败。所以我很确定这是正确的解决方案。

相关内容