Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4239208
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:00:17+00:00 2026-05-21T03:00:17+00:00

When run from the command-line ( emacs filename.py ) flymake and pylint work perfectly

  • 0

When run from the command-line (emacs filename.py) flymake and pylint work perfectly together. Errors are highlighted properly. (Although I can’t tooltip hover to get error details because it’s text-mode.)

When run from the GUI (Carbon Emacs) Flymake returns immediately, and the first line in the file is highlighted with the error “in <module>“. The first line is shows the error even on a “Hello World” script.) I’d like to get it working properly in GUI mode so that I can navigate with the mouse (I know, I know) and use tooltips to get details on the pylint reported errors.

I installed pylint with “easy_install pylint“, and the pylint and epylint scripts are in “~/py/scripts“. I added that directory to my PATH in my .bashrc:

export PATH=$PATH:~/py/scripts

(My .profile is a symlink to my .bashrc.)

I realized that Emacs-GUI was not loading the path from my .bashrc, so I created a ~/.MacOSX/environment.plist file, setting the PATH variable with the full PATH I see in the terminal.

Now in Emacs-GUI “(getenv "PATH")” the output appears correct:

"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Users/schof/py/scripts:/usr/X11R6/bin"

Similarly, the output of “C-h v exec-path” appears correct:

("/usr/bin" "/bin" "/usr/sbin" "/sbin" "/usr/local/bin" "/usr/local/git/bin" "/usr/X11/bin" "/Users/schof/py/scripts" "/Applications/Emacs.app/Contents/MacOS/libexec" "/Applications/Emacs.app/Contents/MacOS/bin" "/usr/X11R6/bin")

That leaves me with no further ideas for how I should resolve this. I’m by no means an emacs guru, so it’s possible I’m missing something obvious here; feel free to ask for more details.

OS X 10.6.7; Carbon Emacs 22.3.1; pylint 0.23.0.

Flymake / Pylint code from .emacs:

  (when (load "flymake" t)
      (defun flymake-pylint-init ()
        (let* ((temp-file (flymake-init-create-temp-buffer-copy
                           'flymake-create-temp-inplace))
           (local-file (file-relative-name
                        temp-file
                        (file-name-directory buffer-file-name))))
          (list "epylint" (list local-file))))

      (add-to-list 'flymake-allowed-file-name-masks
               '("\\.py\\'" flymake-pylint-init)))


;; Auto-start flymake-mode when you go into python-mode
(add-hook 'python-mode-hook
          '(lambda ()
                   (setq python-indent 4)
                   (flymake-mode)))

Update 2011-04-05 in response to @sanityinc’s answer:

Verbosity level 3 output of flymake in *messages*: (This does not make the source of the problem obvious to me.)

starting syntax check as new-line has been seen
flymake is running: nil
file /Users/schof/pytest.py, init=flymake-pylint-init [3 times]
create-temp-inplace: file=/Users/schof/pytest.py temp=/Users/schof/pytest_flymake.py
saved buffer pytest.py in file /Users/schof/pytest_flymake.py
started process 3221, command=(epylint pytest_flymake.py), dir=/Users/schof/
received 704 byte(s) of output from process 3221
file /Users/schof/pytest.py, init=flymake-pylint-init
parsed 'Traceback (most recent call last):', no line-err-info
parse line: file-idx=2 line-idx=3 file=/Users/schof/py/scripts/epylint line=4 text=in <module>
get-real-file-name: file-name=/Users/schof/py/scripts/epylint real-name=~/py/scripts/epylint
parsed '  File "/Users/schof/py/scripts/epylint", line 4, in <module>', got line-err-info
parsed '    import pkg_resources', no line-err-info
parse line: file-idx=2 line-idx=3 file=/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py line=2556 text=in <module>
get-real-file-name: file-name=/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py real-name=/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py
parsed '  File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 2556, in <module>', got line-err-info
parsed '    working_set.require(__requires__)', no line-err-info
parse line: file-idx=2 line-idx=3 file=/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py line=620 text=in require
get-real-file-name: file-name=/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py real-name=/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py
parsed '  File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 620, in require', got line-err-info
parsed '    needed = self.resolve(parse_requirements(requirements))', no line-err-info
parse line: file-idx=2 line-idx=3 file=/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py line=518 text=in resolve
get-real-file-name: file-name=/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py real-name=/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py
parsed '  File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 518, in resolve', got line-err-info
parsed '    raise DistributionNotFound(req)  # XXX put more info here', no line-err-info
parsed 'pkg_resources.DistributionNotFound: pylint==0.23.0', no line-err-info
file /Users/schof/pytest.py, init=flymake-pylint-init
process 3221 exited with code 1
cleaning up using flymake-simple-cleanup
deleted file /Users/schof/pytest_flymake.py
created an overlay at (1-18)
pytest.py: 4 error(s), 0 warning(s) in 0.47 second(s)

For comparison, here is the output from flymake verbosity 3 when run from emacs text mode. The “hello world” file passed all pylint tests.

starting syntax check as new-line has been seen                                                                         
flymake is running: nil                                                                                                 
file /Users/schof/pytest.py, init=flymake-pylint-init [3 times]                                                         
create-temp-inplace: file=/Users/schof/pytest.py temp=/Users/schof/pytest_flymake.py                                    
saved buffer pytest.py in file /Users/schof/pytest_flymake.py                                                           
started process 3395, command=(epylint pytest_flymake.py), dir=/Users/schof/                                            
file /Users/schof/pytest.py, init=flymake-pylint-init                                                                   
process 3395 exited with code 0                                                                                         
cleaning up using flymake-simple-cleanup                                                                                
deleted file /Users/schof/pytest_flymake.py                                                                             
pytest.py: 0 error(s), 0 warning(s) in 0.30 second(s) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T03:00:17+00:00Added an answer on May 21, 2026 at 3:00 am

    To more clearly see what’s going wrong, increase flymake’s log level, then look in *messages*:

    (setq flymake-log-level 3)
    

    Without that info, I wouldn’t speculate on the likely problem.

    There’s a trick for avoiding the environment.plist approach, BTW; you can get Emacs to ask your regular shell for your preferred PATH:

    (defun set-exec-path-from-shell-PATH ()
      (let ((path-from-shell (replace-regexp-in-string
                              "[ \t\n]*$"
                              ""
                              (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
        (setenv "PATH" path-from-shell)
        (setq exec-path (split-string path-from-shell path-separator))))
    
    (when (and window-system (eq system-type 'darwin))
      ;; When started from Emacs.app or similar, ensure $PATH
      ;; is the same the user would see in Terminal.app
      (set-exec-path-from-shell-PATH))
    

    (That’s lifted from my Emacs config, which has a bunch of flymake code in it, including a config for python using pyflakes, so you might want to take a look.)

    Update: Now that you’ve added the verbose output, I see that your ~/py/epylint program can’t find pkg_resources, which points to PYTHONPATH being wrong. So, using a variation on the above technique, try this:

    (defun setenv-from-shell (varname)
      (setenv varname (replace-regexp-in-string
                       "[ \t\n]*$"
                       ""
                       (shell-command-to-string (concat "$SHELL --login -i -c 'echo $" varname "'")))))
    
    (setenv-from-shell "PYTHONPATH")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am familiar with using the os.system to run from the command line. However,
I need a doc to rtf converter that will run from the command line,
I want to run mvn tomcat:run from the command line, but how can I
I have a perl script which when run from the command line generates a
I have a long-running Python script that I run from the command-line. The script
I want to use part of the output of a command run from the
Is there an easy way to run a MySQL query from the Linux command
I need to run a Linux CLI command and get its stdout output from
I want to run a shell command in Terminal, then clear the console, from
I'm running a script from crontab that will just ssh and run a command

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.