安装 Pandoc(docverter 需要)

tim*_*son 16 pandoc software-installation

对于我的生活,我无法弄清楚如何安装 pandoc。我尝试了其 Github 存储库上推荐的方法以及pandoc 站点上推荐的所有3 种方法。我在 Ubuntu 12.04 上安装,所以我首先做了sudo apt-get install haskell-platform.

以下是每一步发生错误的地方:

1) 按照 Github 存储库上的建议进行安装:

# cabal install --enable-tests
Registering zlib-conduit-1.0.0...
cabal: Error: some packages failed to install:
http-conduit-1.9.4.5 depends on mime-types-0.1.0.3 which failed to install.
mime-types-0.1.0.3 failed during the building phase. The exception was:
ExitFailure 9
pandoc-1.12 depends on mime-types-0.1.0.3 which failed to install.
Run Code Online (Sandbox Code Playgroud)

2) Pandoc 站点上的主要安装方法:

# cabal install pandoc
[35 of 45] Compiling Text.Pandoc.Parsing ( src/Text/Pandoc/Parsing.hs, dist/build/Text/Pandoc/Parsing.o )
cabal: Error: some packages failed to install:
pandoc-1.11.1 failed during the building phase. The exception was:
ExitFailure 9
Run Code Online (Sandbox Code Playgroud)

3)“如果我的发行版有 GHC 6.12”

# cabal install cabal-install
[46 of 67] Compiling Distribution.Simple.LocalBuildInfo ( Distribution/Simple/LocalBuildInfo.hs, dist/build/Distribution/Simple/LocalBuildInfo.o )
cabal: Error: some packages failed to install:
Cabal-1.16.0.3 failed during the building phase. The exception was:
ExitFailure 9
cabal-install-1.16.0.2 depends on Cabal-1.16.0.3 which failed to install.
Run Code Online (Sandbox Code Playgroud)

4) 安装压缩包:

# cabal install pandoc
[23 of 45] Compiling Text.Pandoc.Writers.Texinfo ( src/Text/Pandoc/Writers/Texinfo.hs, dist/build/Text/Pandoc/Writers/Texinfo.o )
cabal: Error: some packages failed to install:
pandoc-1.11.1 failed during the building phase. The exception was:
ExitFailure 9
Run Code Online (Sandbox Code Playgroud)

amc*_*amc 19

您可以直接从 repos 安装:

sudo apt-get install pandoc
Run Code Online (Sandbox Code Playgroud)

  • 我通过这种方式得到了`pandoc 1.9.1.1`。没有可用的最新版本吗? (8认同)

Ben*_*Ben 19

我发现安装cabal在我的虚拟机中占用了大量磁盘空间,所以我更喜欢使用debpandoc 开发人员提供的。这是我下载和安装当前 deb(对于 pandoc v15.1.1)的操作:

sudo wget https://github.com/jgm/pandoc/releases/download/1.15.1/pandoc-1.15.1-1-amd64.deb
sudo dpkg -i pandoc-1.15.1-1-amd64.deb
Run Code Online (Sandbox Code Playgroud)

你可以在这里查看最新的版本号:https : //github.com/jgm/pandoc/releases/


  • 这是迄今为止在我的 DigitalOcean vps 上安装最新版本 Pandoc 的更简单的解决方案。apt-get 版本是 1.12(我相信)并使用此方法下载最新的软件包安装了 v1.17,其中包括从 docx 转换的精彩功能,这是我所追求的。谢谢@本! (2认同)

小智 12

正如 Stephane Laurent 所指出的,repos 中的 pandoc 版本远非最新版本,并且不允许使用--biblio. 我努力使用pandoc 网站github上的说明安装最新版本,但这是我最终为 Ubuntu 13.10 安装的方法。

  1. 安装 cabal

    sudo apt-get install cabal-install
    
    Run Code Online (Sandbox Code Playgroud)
  2. 更新cabal包数据库

    cabal update
    
    Run Code Online (Sandbox Code Playgroud)
  3. 确保路径cabal位于PATH 的开头(来自此处的提示)

    PATH=$HOME/.cabal/bin:$PATH
    
    Run Code Online (Sandbox Code Playgroud)
  4. 使用cabal安装alexhappy

    cabal install alex happy
    
    Run Code Online (Sandbox Code Playgroud)
  5. 使用cabal安装pandoc(和pandoc-citeproc如果希望)

    cabal install pandoc pandoc-citeproc
    
    Run Code Online (Sandbox Code Playgroud)
  6. 检查 pandoc 版本以确认已安装

    pandoc --version
    
    Run Code Online (Sandbox Code Playgroud)

您需要将该PATH=$HOME/.cabal/bin:$PATH命令添加到您的~/.profile 中,以便在您下次重新启动时可用。快乐转换!