Closed zeta-00 closed 4 years ago
also, i'm using ihaskell in an isolated nix environment in emacs, but, i don't think that's causing the errors that ein is throwing.
i forgot to enable the debugger in emacs, here's the debug errors that ein is throwing:
Debugger entered--Lisp error: (error "Command jupyter not found or not executable") signal(error ("Command jupyter not found or not executable")) error("Command %s not found or not executable" "jupyter") ein:run(nil "~/.ihaskell/notebooks/" nil #f(compiled-function (buffer url-or-port) #<bytecode 0x180fb89>)) funcall-interactively(ein:run nil "~/.ihaskell/notebooks/" nil #f(compiled-function (buffer url-or-port) #<bytecode 0x180fb89>)) call-interactively(ein:run record nil) command-execute(ein:run record) execute-extended-command(nil "ein:run" "ein:run") funcall-interactively(execute-extended-command nil "ein:run" "ein:run") call-interactively(execute-extended-command nil nil) command-execute(execute-extended-command)
(setq ein:polymode t)
(setq ein:completion-backend 'ein:use-company-backend)
Unrelated to the PATH issue, you should get rid of these lines.
Command not found
seems to happen with some frequency in the wild. Earlier instances documented at #601 and #638 .
Commit e39a483 pulls in purcell/exec-path-from-shell to ensure your shell's PATH variable gets copied into emacs. It may not solve the problem, though, so failing that, I'd need to see the output of M-x getenv RET PATH
.
@dickmao ok, M-x getenv RET PATH, returned:
/nix/store/hdybipp5dymakgkp14z7gnp5da23n0zf-patchelf-0.9/bin:/nix/store/xh3bh8nir5d45zk45dz9xxfs2j95cby4-gcc-wrapper-9.2.0/bin:/nix/store/mjvz9b02v42lngkn4dxal6n1xrv8wx9l-gcc-9.2.0/bin:/nix/store/2p6ji9i05dkjz3fgpvymlawl379fw577-glibc-2.30-bin/bin:/nix/store/7g6ar24krh7vn66gvfwwv3nq9xsh5c6i-coreutils-8.31/bin:/nix/store/axkkr27z9cjzxac1c9s6ngda73kbz063-binutils-wrapper-2.31.1/bin:/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin:/nix/store/2p6ji9i05dkjz3fgpvymlawl379fw577-glibc-2.30-bin/bin:/nix/store/7g6ar24krh7vn66gvfwwv3nq9xsh5c6i-coreutils-8.31/bin:/nix/store/92hfpjgipz9mi8xw3mkdsdk7sxz2d21j-ihaskell-with-packages/bin:/nix/store/7g6ar24krh7vn66gvfwwv3nq9xsh5c6i-coreutils-8.31/bin:/nix/store/w9l2nmg6pclz944f33zg17bpgvq27f4f-findutils-4.7.0/bin:/nix/store/48jg7qxx2i3ndgr1b67imy6qr2nvsfjx-diffutils-3.7/bin:/nix/store/5gqv9dn7yih5hsz5by9mxhf2384zjsza-gnused-4.8/bin:/nix/store/rdl0mdfawd3gyv45nml3n6iw134d2g8h-gnugrep-3.4/bin:/nix/store/2z51w65pm8vap5j0p2hidyss09cyc8m3-gawk-5.0.1/bin:/nix/store/c98k0shcp2yp69g81mqhbqw3xbxvnk0r-gnutar-1.32/bin:/nix/store/rj2642fn2ciqwiihvv607n68fiy4qbdc-gzip-1.10/bin:/nix/store/r1hncr91kzyscxiab3c7wlfmvrhx01x6-bzip2-1.0.6.0.1-bin/bin:/nix/store/k5r4w2wlsycpqppf3gpda1hyx6sc62i7-gnumake-4.2.1/bin:/nix/store/x7fr0bvnwvqvr3zg60di9jxvfwimcw7m-bash-4.4-p23/bin:/nix/store/smccfl7q9cz2ilzds5rg6f02l41s647p-patch-2.7.6/bin:/nix/store/4ih4qpvh7ydzw3m5a2q623a6nbp089fp-xz-5.2.4-bin/bin:/run/wrappers/bin:/home/zeta/.nix-profile/bin:/etc/profiles/per-user/zeta/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin
And I presume the jupyter executable does not reside in any of these directories? For the purposes of pinpointing the problem, you need to spawn emacs from a shell where jupyter was found.
@dickmao ok, i'm not sure why the jupyter executable is not on the PATH, but i'll look into it some more, also the reason i have that elisp code for ein in my .emacs is because, it was recommend my @millejoh a couple of months ago in order to fix some other errors that i had:
https://github.com/millejoh/emacs-ipython-notebook/issues/642
https://github.com/millejoh/emacs-ipython-notebook/issues/636
But jupyter
is clearly on the PATH in the message at the top of this page. So you need to get back to that prompt, re-ensure jupyter --version
returns that same output, start emacs from that prompt, M-x getenv RET PATH
and figure out why PATH in emacs doesn't match the shell's PATH.
@dickmao well, my setup is: (lorri+direnv+emacs-direnv), this configuration is used for building an isolated nix environment to work in emacs using a shell(M-x shell), so far it has worked great for all my other projects, but for some reason ihaskell has been giving me issues with this setup.
If this issue is more related to nix, i can go elsewhere to ask for help, those errors look more related to emacs, that's why i came here to ask for help with fixing this.
@dickmao if you have any tips for troubleshooting this issue, let me know, in the mean time, i'm going to ask the nix people if they know what is wrong.
I'm afraid you've lost me. As far as I can tell, jupyter
resides in your PATH at the prompt (because jupyter --version
works), then you launch emacs, and M-x getenv RET PATH
yields a path that no longer contains jupyter
.
A similar phenomenon has been reported at https://github.com/purcell/exec-path-from-shell
Ever find that a command works in your shell, but not in Emacs? This happens a lot on OS X, where an Emacs instance started from the GUI inherits a default set of environment variables.
and commit e39a483 applies the fix from that repo to this repo. If that doesn't fly, then I'm afraid I can't help you. From your replies, it's not clear whether you understand the notion of a UNIX path.
@dickmao ok, well, thank you for the help, i'll look more into that stuff.
https://github.com/syl20bnr/spacemacs/issues/2294 seems relevant.
i have a related issue, where i can't get ein to look at the jupyter and python package set from direnv
(specifically nix-direnv
)
hello there, i installed ihaskell using nix and and everything seems to be working fine:
[zeta@nixos:/.ihaskell]$ ihaskell --version 0.10.1.0 (lorri)
[zeta@nixos:/.ihaskell]$ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.8.3 (lorri)
[zeta@nixos:/.ihaskell]$ jupyter --version jupyter core : 4.6.1 jupyter-notebook : 6.0.3 qtconsole : not installed ipython : 7.12.0 ipykernel : 5.1.4 jupyter client : 5.3.4 jupyter lab : 1.2.6 nbconvert : 5.6.1 ipywidgets : not installed nbformat : 5.0.4 traitlets : 4.3.3 [zeta@nixos:/.ihaskell]$ (lorri)
but, for some reason whenever i type: M-x ein:run, emacs throws these errors?
as you can see by the jupyter --version command, jupyter is installed, so i have no idea why ein is not detecting it?
also here's the code that i'm using in my .emacs config for ein:
;;------------------------------------------------------------------ (setq ein:polymode t) (add-hook 'after-init-hook 'global-company-mode) (setq ein:completion-backend 'ein:use-company-backend) ;;------------------------------------------------------------------