Skip to content
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

Python executable lookup fails with relative paths #113

Open
timor opened this issue Aug 14, 2017 · 0 comments
Open

Python executable lookup fails with relative paths #113

timor opened this issue Aug 14, 2017 · 0 comments

Comments

@timor
Copy link

timor commented Aug 14, 2017

These lines

ob-ipython/ob-ipython.el

Lines 169 to 172 in a0ae4ad

(let* ((python (locate-file (if (eq system-type 'windows-nt)
"python.exe"
(or python-shell-interpreter "python"))
exec-path))

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant