syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.9k forks source link

python-pyflakes must be a string: flycheck-pyflakes-executable #8583

Closed sebhahn closed 7 years ago

sebhahn commented 7 years ago

Description :octocat:

On start-up error of pyflakes error: python-pyflakes must be a string: flycheck-pyflakes-executable

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: On start-up error of pyflakes error: python-pyflakes must be a string: flycheck-pyflakes-executable

Expected behaviour: :heart: :smile: No error

System Info :computer:

Backtrace :paw_prints:

Debugger entered--Lisp error: (error "Command executable for syntax checker python-pyflakes must be a string: flycheck-pyflakes-executable")
  signal(error ("Command executable for syntax checker python-pyflakes must be a string: flycheck-pyflakes-executable"))
  error("Command executable for syntax checker %s must be a string: %S" python-pyflakes flycheck-pyflakes-executable)
  flycheck-define-command-checker(python-pyflakes "A Python syntax and style checker using the pyflakes utility.\n\nSee URL `http://pypi.python.org/pypi/pyflakes'." :command (flycheck-pyflakes-executable source-inplace) :error-patterns ((error line-start (file-name) ":" line ":" (message) line-end)) :modes python-mode :next-checkers nil :standard-input nil :working-directory nil)
  byte-code("\300\301\302\303\304\305\306\307\310\311&  \210\312\313\314\315\316\317\320\321\322\323\302\324\302\325\302&\210\326\327\313\"\210\330\331!\207" [custom-declare-variable flycheck-python-pyflakes-executable nil "The executable of the python-pyflakes syntax checker.\n\nEither a string containing the name or the path of the\nexecutable, or nil to use the default executable from the syntax\nchecker declaration.\n\nThe default executable is flycheck-pyflakes-executable." :type (choice (const :tag "Default executable" nil) (string :tag "Name or path")) :group flycheck-executables :risky t flycheck-define-command-checker python-pyflakes "A Python syntax and style checker using the pyflakes utility.\n\nSee URL `http://pypi.python.org/pypi/pyflakes'." :command (flycheck-pyflakes-executable source-inplace) :error-patterns ((error line-start (file-name) ":" line ":" (message) line-end)) :modes python-mode :next-checkers :standard-input :working-directory add-to-list flycheck-checkers provide flycheck-pyflakes] 15)
  require(flycheck-pyflakes nil t)
  (not (require (quote flycheck-pyflakes) nil (quote t)))
  (if (not (require (quote flycheck-pyflakes) nil (quote t))) (ignore (message (format "Cannot load %s" (quote flycheck-pyflakes)))))
  (prog1 (if (not (require (quote flycheck-pyflakes) nil (quote t))) (ignore (message (format "Cannot load %s" (quote flycheck-pyflakes))))) (let ((elapsed (float-time (time-subtract (current-time) now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Loading package flycheck-pyflakes" elapsed) (message "%s...done" "Loading package flycheck-pyflakes"))))
  (let ((now (current-time))) (message "%s..." "Loading package flycheck-pyflakes") (prog1 (if (not (require (quote flycheck-pyflakes) nil (quote t))) (ignore (message (format "Cannot load %s" (quote flycheck-pyflakes))))) (let ((elapsed (float-time (time-subtract (current-time) now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Loading package flycheck-pyflakes" elapsed) (message "%s...done" "Loading package flycheck-pyflakes")))))
  (use-package flycheck-pyflakes)
  python-config/init-flycheck-pyflakes()
  funcall(python-config/init-flycheck-pyflakes)
  (let* ((pkg-name (eieio-oref pkg (quote :name))) (owner (car (eieio-oref pkg (quote :owners))))) (spacemacs-buffer/message (format "Configuring %S..." pkg-name)) (mapc (function (lambda (layer) (if (configuration-layer/layer-usedp layer) (progn (if (not ...) (spacemacs-buffer/message ...) (spacemacs-buffer/message ...) (condition-case err ... ...)))))) (eieio-oref pkg (quote :pre-layers))) (spacemacs-buffer/message (format "  -> init (%S)..." owner)) (funcall (intern (format "%S/init-%S" owner pkg-name))) (mapc (function (lambda (layer) (if (configuration-layer/layer-usedp layer) (progn (if (not ...) (spacemacs-buffer/message ...) (spacemacs-buffer/message ...) (condition-case err ... ...)))))) (eieio-oref pkg (quote :post-layers))))
  configuration-layer//configure-package([object cfgl-package "flycheck-pyflakes" flycheck-pyflakes nil (python-config) nil nil elpa t nil nil nil nil])
  (cond ((eq (quote dotfile) (car (eieio-oref pkg (quote :owners)))) (spacemacs-buffer/message (format "%S is configured in the dotfile." pkg-name))) (t (configuration-layer//configure-package pkg)))
  (cond ((eieio-oref pkg (quote :lazy-install)) (spacemacs-buffer/message (format "%S ignored since it can be lazily installed." pkg-name))) ((and (eieio-oref pkg (quote :excluded)) (not (eieio-oref pkg (quote :protected)))) (spacemacs-buffer/message (format "%S ignored since it has been excluded." pkg-name))) ((null (eieio-oref pkg (quote :owners))) (spacemacs-buffer/message (format "%S ignored since it has no owner layer." pkg-name))) ((not (cfgl-package-enabledp pkg)) (spacemacs-buffer/message (format "%S is toggled off." pkg-name))) (t (let ((dir (configuration-layer/get-location-directory pkg-name (eieio-oref pkg (quote :location)) (car (eieio-oref pkg ...))))) (if dir (progn (add-to-list (quote load-path) dir)))) (if (memq (eieio-oref pkg (quote :location)) (quote (local site built-in))) nil (configuration-layer//activate-package pkg-name)) (cond ((eq (quote dotfile) (car (eieio-oref pkg (quote :owners)))) (spacemacs-buffer/message (format "%S is configured in the dotfile." pkg-name))) (t (configuration-layer//configure-package pkg)))))
  (let ((pkg (configuration-layer/get-package pkg-name))) (cond ((eieio-oref pkg (quote :lazy-install)) (spacemacs-buffer/message (format "%S ignored since it can be lazily installed." pkg-name))) ((and (eieio-oref pkg (quote :excluded)) (not (eieio-oref pkg (quote :protected)))) (spacemacs-buffer/message (format "%S ignored since it has been excluded." pkg-name))) ((null (eieio-oref pkg (quote :owners))) (spacemacs-buffer/message (format "%S ignored since it has no owner layer." pkg-name))) ((not (cfgl-package-enabledp pkg)) (spacemacs-buffer/message (format "%S is toggled off." pkg-name))) (t (let ((dir (configuration-layer/get-location-directory pkg-name (eieio-oref pkg ...) (car ...)))) (if dir (progn (add-to-list (quote load-path) dir)))) (if (memq (eieio-oref pkg (quote :location)) (quote (local site built-in))) nil (configuration-layer//activate-package pkg-name)) (cond ((eq (quote dotfile) (car (eieio-oref pkg ...))) (spacemacs-buffer/message (format "%S is configured in the dotfile." pkg-name))) (t (configuration-layer//configure-package pkg))))))
  (while --dolist-tail-- (setq pkg-name (car --dolist-tail--)) (spacemacs-buffer/loading-animation) (let ((pkg (configuration-layer/get-package pkg-name))) (cond ((eieio-oref pkg (quote :lazy-install)) (spacemacs-buffer/message (format "%S ignored since it can be lazily installed." pkg-name))) ((and (eieio-oref pkg (quote :excluded)) (not (eieio-oref pkg (quote :protected)))) (spacemacs-buffer/message (format "%S ignored since it has been excluded." pkg-name))) ((null (eieio-oref pkg (quote :owners))) (spacemacs-buffer/message (format "%S ignored since it has no owner layer." pkg-name))) ((not (cfgl-package-enabledp pkg)) (spacemacs-buffer/message (format "%S is toggled off." pkg-name))) (t (let ((dir (configuration-layer/get-location-directory pkg-name ... ...))) (if dir (progn (add-to-list ... dir)))) (if (memq (eieio-oref pkg (quote :location)) (quote (local site built-in))) nil (configuration-layer//activate-package pkg-name)) (cond ((eq (quote dotfile) (car ...)) (spacemacs-buffer/message (format "%S is configured in the dotfile." pkg-name))) (t (configuration-layer//configure-package pkg)))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- packages) pkg-name) (while --dolist-tail-- (setq pkg-name (car --dolist-tail--)) (spacemacs-buffer/loading-animation) (let ((pkg (configuration-layer/get-package pkg-name))) (cond ((eieio-oref pkg (quote :lazy-install)) (spacemacs-buffer/message (format "%S ignored since it can be lazily installed." pkg-name))) ((and (eieio-oref pkg (quote :excluded)) (not (eieio-oref pkg ...))) (spacemacs-buffer/message (format "%S ignored since it has been excluded." pkg-name))) ((null (eieio-oref pkg (quote :owners))) (spacemacs-buffer/message (format "%S ignored since it has no owner layer." pkg-name))) ((not (cfgl-package-enabledp pkg)) (spacemacs-buffer/message (format "%S is toggled off." pkg-name))) (t (let ((dir ...)) (if dir (progn ...))) (if (memq (eieio-oref pkg ...) (quote ...)) nil (configuration-layer//activate-package pkg-name)) (cond ((eq ... ...) (spacemacs-buffer/message ...)) (t (configuration-layer//configure-package pkg)))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  configuration-layer//configure-packages-2((2048-game abbrev ac-ispell ace-jump-helm-line ace-link ace-window adaptive-wrap aggressive-indent alchemist anaconda-mode ansi-colors ansible ansible-doc archive-mode auctex auctex-latexmk auto-compile auto-complete auto-dictionary auto-highlight-symbol auto-yasnippet avy biblio biblio-core bookmark bracketed-paste bundler cc-mode centered-buffer-mode centered-cursor chruby clang-format clean-aindent-mode cmake-mode color-identifiers-mode column-enforce-mode comint company company-anaconda company-ansible company-auctex company-c-headers company-quickhelp company-statistics company-web conf-mode css-mode cython-mode debug default-helm-config ...))
  configuration-layer//configure-packages((2048-game abbrev ac-ispell ace-jump-helm-line ace-link ace-window adaptive-wrap aggressive-indent alchemist anaconda-mode ansi-colors ansible ansible-doc archive-mode async auctex auctex-latexmk auto-compile auto-complete auto-dictionary auto-highlight-symbol auto-yasnippet avy biblio biblio-core bind-key bind-map bookmark bracketed-paste bundler cc-mode centered-buffer-mode centered-cursor chruby clang-format clean-aindent-mode cmake-mode color-identifiers-mode column-enforce-mode comint company company-anaconda company-ansible company-auctex company-c-headers company-quickhelp company-statistics company-web conf-mode css-mode ...))
  configuration-layer/sync()
  (if (not (version<= spacemacs-emacs-min-version emacs-version)) (error (concat "Your version of Emacs (%s) is too old. " "Spacemacs requires Emacs version %s or above.") emacs-version spacemacs-emacs-min-version) (load-file (concat (file-name-directory load-file-name) "core/core-load-paths.el")) (require (quote core-spacemacs)) (spacemacs/init) (configuration-layer/sync) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (require (quote server)) (if (server-running-p) nil (server-start)))
  eval-buffer(#<buffer  *load*> nil "/home/shahn/.emacs.d/init.el" nil t)  ; Reading at buffer position 1264
  load-with-code-conversion("/home/shahn/.emacs.d/init.el" "/home/shahn/.emacs.d/init.el" t t)
  load("/home/shahn/.emacs.d/init" t t)
  #[0 "\205\262   \306=\203\307\310Q\202; \311=\204\307\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB\321\202;\316\322\323\322\211#\210\322=\203a\324\325\326\307\327Q!\"\323\322\211#\210\322=\203`\210\203\243\330!\331\232\203\243\332!\211\333P\334!\203}\211\202\210\334!\203\207\202\210\314\262\203\241\335\"\203\237\336\337#\210\340\341!\210\266\f?\205\260\314\323\342\322\211#)\262\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "`_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
  command-line()
  normal-top-level()
bmag commented 7 years ago

From the backtrace:

python-config/init-flycheck-pyflakes()

You need to fix your configuration for flycheck-pyflakes. Check if anything in your config sets flycheck-pyflakes-executable (including custom-set-* sections).

sebhahn commented 7 years ago

Thanks @bmag, I thought it was a general problem! Isn't the value set automatically here?

bmag commented 7 years ago

defvar sets the value only if the variable hasn't been set elsewhere. Your config probably sets it at some point. For more info: https://www.gnu.org/software/emacs/manual/html_node/elisp/index.html

sebhahn commented 7 years ago

Is there an easy way to find where it has been set before?

bmag commented 7 years ago

You can search ~/.emacs.d, ~/.spacemacs and ~/.spacemacs.d/ (if you have one) for "flycheck-pyflakes-executable", using a standard search tool.

sebhahn commented 7 years ago

Thanks! Isn't it set using the :command here

Sorry for these kind of questions, but I'm a Lisp newbie.

bmag commented 7 years ago

Can't say for sure without reading Flycheck's code, but I doubt it. Looks like it's used there, not set.

Wilfred commented 7 years ago

Woops! Sorry about that folks. I've fixed this in flycheck-pyflakes so it should now work if you upgrade.

sebhahn commented 7 years ago

Latest update fixes the problem! Thanks @Wilfred! :+1: