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

No such file or directory pipenv #59

Closed
trev-dev opened this issue Sep 6, 2021 · 10 comments
Closed

No such file or directory pipenv #59

trev-dev opened this issue Sep 6, 2021 · 10 comments

Comments

@trev-dev
Copy link

trev-dev commented Sep 6, 2021

Emacs 27.2
pipenv, version 2021.5.29 installed via pip
Python 3.9.6 on Fedora 34

Config:

(use-package pipenv
  :hook (python-mode . pipenv-mode)
  :init
  (setq
   pipenv-projectile-after-switch-function
   #'pipenv-projectile-after-switch-extended))

Whenever I enter a python file or activate pipenv-mode I get:
Cannot open load file: No such file or directory, pipenv

Pipenv is executable from the cli and is on my shell PATH.

@conao3
Copy link
Collaborator

conao3 commented Sep 6, 2021

Please check your Emacs could find pipenv. What will be the output If you eval (executable-find "pipenv").

@trev-dev
Copy link
Author

trev-dev commented Sep 6, 2021

Seems to find it where it is on my PATH: /home/user/.local/bin/pipenv

@conao3
Copy link
Collaborator

conao3 commented Sep 6, 2021

hmm, your Emacs can find pipenv.
Could you get Elisp backtrace? Before occur that Error, set debug-on-error as t via (setq debug-on-error t).

@trev-dev
Copy link
Author

trev-dev commented Sep 7, 2021

Sure. Here's the error that crops up:

Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "pipenv")
  pipenv-mode()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook python-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook python-mode-hook))
  run-mode-hooks(python-mode-hook)
  python-mode()
  set-auto-mode-0(python-mode nil)
  #f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the filename against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode 0x1fc479352885>)()
  apply(#f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the filename against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode 0x1fc479352885>) nil)
  so-long--set-auto-mode(#f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the filename against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode 0x1fc479352885>))
  apply(so-long--set-auto-mode #f(compiled-function (&optional keep-mode-if-same) "Select major mode appropriate for current buffer.\n\nTo find the right major mode, this function checks for a -*- mode tag\nchecks for a `mode:' entry in the Local Variables section of the file,\nchecks if it uses an interpreter listed in `interpreter-mode-alist',\nmatches the buffer beginning against `magic-mode-alist',\ncompares the filename against the entries in `auto-mode-alist',\nthen matches the buffer beginning against `magic-fallback-mode-alist'.\n\nIf `enable-local-variables' is nil, or if the file name matches\n`inhibit-local-variables-regexps', this function does not check\nfor any mode: tag anywhere in the file.  If `local-enable-local-variables'\nis nil, then the only mode: tag that can be relevant is a -*- one.\n\nIf the optional argument KEEP-MODE-IF-SAME is non-nil, then we\nset the major mode only if that would change it.  In other words\nwe don't actually set it to the same mode the buffer already has." #<bytecode 0x1fc479352885>) nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer test.py> "~/Projects/project/test.py" nil nil "~/Projects/project/test.py" (2037836 41))
  find-file-noselect("/home/trevdev/Projects/project/test.py" nil nil nil)
  find-file("/home/trevdev/Projects/project/test.py")
  projectile--find-file(nil)
  projectile-find-file()
  projectile-switch-project-by-name("~/Projects/project/" nil)
  #f(compiled-function (project) #<bytecode 0x2fcef39>)("~/Projects/project/")
  ivy-call()
  ivy-read()
  projectile-completing-read()
  projectile-switch-project(nil)
  funcall-interactively(projectile-switch-project nil)
  call-interactively(projectile-switch-project nil nil)
  command-execute(projectile-switch-project)

@conao3
Copy link
Collaborator

conao3 commented Sep 7, 2021

weird...
pipenv-mode() doesn't access any pipenv so I cannot understand why it occur file-missing error...

pipenv.el/pipenv.el

Lines 462 to 465 in 8f50c68

(define-minor-mode pipenv-mode
"Minor mode for Pipenv."
:lighter " Pipenv"
:keymap pipenv-mode-map)

Please check you can M-x pipenv-deactivate and M-x pipenv-activate. And if you see error, please tell me its backtrace.

@trev-dev
Copy link
Author

trev-dev commented Sep 7, 2021

I don't seem to have access to those functions. I imagine it's because I cannot activate pipenv-mode

@conao3
Copy link
Collaborator

conao3 commented Sep 7, 2021

Yes, the issue you face is Your Emacs cannot find "pipenv.el" instead of "pipenv" cli binary. Please check pipenv.el installation.

@conao3
Copy link
Collaborator

conao3 commented Sep 7, 2021

missing :ensure t?

(use-package pipenv
  :ensure t
  :hook (python-mode . pipenv-mode)
  :init
  (setq
   pipenv-projectile-after-switch-function
   #'pipenv-projectile-after-switch-extended))

@trev-dev
Copy link
Author

trev-dev commented Sep 7, 2021

Well shit

I'm sorry I wasted your time.

@trev-dev trev-dev closed this as completed Sep 7, 2021
@conao3
Copy link
Collaborator

conao3 commented Sep 7, 2021

lol. No problem!

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

2 participants