ob-ipython icon indicating copy to clipboard operation
ob-ipython copied to clipboard

Python executable lookup fails with relative paths

Open timor opened this issue 8 years ago • 0 comments

These lines

https://github.com/gregsexton/ob-ipython/blob/a0ae4add0310d131c6b4b15139b929955cec93dd/ob-ipython.el#L169-L172

assume that python is somewhere on the system's executable path. I don't think this is a good idea, as e.g. on my NixOS system, this is not the case, and I want to specify an executable relative to the current file.

Note that the corresponding code which gets called for org-babel-python functionality adds the current directory to the lookup path before resolving the command (this is deep down in comint.el)

(let ((exec-path (if (and command (file-name-directory command))
		 ;; If the command has slashes, make sure we
		 ;; first look relative to the current directory.
		 (cons default-directory exec-path) exec-path)))

Since ob-ipython does not seem to travel that code path, I think it makes sense to copy that behavior.

timor avatar Aug 14 '17 13:08 timor