JessicaTegner/pypandoc

download_pandoc is not working

Closed this issue · 3 comments

download_pandoc fails because there is no pandoc-citeproc in the package.

$ python3 -c 'from pypandoc.pandoc_download import download_pandoc; download_pandoc(targetfolder=".")'
* Using already downloaded file pandoc-2.11-1-amd64.deb
* Unpacking pandoc-2.11-1-amd64.deb to tempfolder...
* Copying pandoc to . ...
* Making ./pandoc executeable...
* Copying pandoc-citeproc to . ...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/test/venv/lib/python3.8/site-packages/pypandoc/pandoc_download.py", line 219, in download_pandoc
unpack(filename, targetfolder)
File "/tmp/test/venv/lib/python3.8/site-packages/pypandoc/pandoc_download.py", line 92, in _handle_linux
shutil.copyfile(src, dst)
File "/usr/lib/python3.8/shutil.py", line 261, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpqnjq5rk_/usr/bin/pandoc-citeproc'

Just hit this same issue. The flow used to work, and it looks like pypandoc hasn't changed, so must be something in the pandoc release that broke this?

pandoc-citeproc is no longer included with Pandoc releases. See 2.11 release notes. Pypandoc will need some changes to accomodate this.

As a gross workaround, you can force pypandoc to install a specific version of pandoc.

$ python3 -c 'from pypandoc.pandoc_download import download_pandoc; download_pandoc(version="2.10.1", targetfolder=".")'

Or if you're using setup.py download_pandoc, before running it use this sed command to add the version number:

$ sed -i -e 's/download_pandoc(targetfolder/download_pandoc(version="2.10.1", targetfolder/;' pypandoc-1.5/setup.py

Hi there

this issue has been fixed, and will be out in the next version, 1.6