-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration broken when pandoc is not in the PATH #72
Comments
Hi @moss-xyz , No, Try The path is not the first but the second argument in configure (the first being "auto"). Makes me wonder if I should make this configure function keyword arguments only ... Cheers, Sébastien |
Hi @boisgera - apologies for the omission in my original post above, I had actually been using a keyword argument: pandoc.configure(path="path/to/conda/env/Library/bin/pandoc.exe") Per my psuedo-path above, pandoc seems to have been installed to Weirdly, |
Ah, too bad, that would have been an easy fix ... AFAICT, the error you have can only happen when the configuration flag That's pretty weird ... except if you have triggered an automatic configuration before you explicitly configure the path. For example, import pandoc
import pandoc.types
pandoc.configure(path="...") would fail at Do you still have the error if all you do is import pandoc
pandoc.configure(path="...") ? |
Yes - just running |
Can you invoke your pandoc executable via For example, my executable is located at "/home/boisgera/.pixi/bin/pandoc" and I can do: >>> import plumbum
>>> p = plumbum.local["/home/boisgera/.pixi/bin/pandoc"]
>>> print(p("--version"))
pandoc 3.2
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /home/boisgera/.local/share/pandoc
Copyright (C) 2006-2024 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose. |
Fascinating! That does seem to work? >>> import plumbum
>>> p = plumbum.local["path/to/env/Library/bin/pandoc.exe"]
>>> print(p("--version"))
pandoc.exe 3.2.1
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: C:\Users\my-name\AppData\Roaming\pandoc
Copyright (C) 2006-2024 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose. Curious what this will tell you |
Well, AFAICT the issue is not that the executable is not available through plumbum when you give it the proper path, but for some reason Unfortunately, I don't have access to Windows (not even via VirtualBox because of ongoing technical issues at Microsoft). Are you by any chance able to use a debugger to go step by step and see if we are executing the |
Nevermind, I can reproduce on Linux, I'll deal with this. Thanks for your feedback! |
Ah, great, let me know! I've actually never used a debugger before but I had just gotten it set up and was stepping through the functions - very cool feature! |
There is a faulty logic here where we import if not read_only: # set the configuration, update pandoc.types
try:
from . import types
except ImportError: # only sensible explanation:
# the types module is actually being imported (interpreted)
# and is calling configure.
types = sys.modules["pandoc.types"]
_configuration = {
"auto": auto,
"path": path,
"version": version,
"pandoc_types_version": pandoc_types_version,
}
types.make_types() The code in _configuration = pandoc.configure(read=True)
if _configuration is None:
pandoc.configure(auto=True)
else:
pandoc.configure(**_configuration) |
Bit of an odd one here, didn't see anyone else with a similar issue that had been posted.
I seem to be able to import the python package, but unable to use it, meaning that the following fails:
It generates the following exception (
CommandNotFound
):Which in turns triggers the following error:
I would have thought the solution to this was to specify the path to
pandoc.exe
withpandoc.configure()
, but that doesn't work either:Is
pandoc
expected to be in my PATH? I installed it from conda using the instructions in the documentation, so not sure why this error is happening. I also tried to install an older version (3.2.1) with conda but it didn't work either.The text was updated successfully, but these errors were encountered: