SublimeLinter-pylint: Cannot get pylint operational
I kind of hate creating an issue for this since I’m quite sure it’s a me problem (I’m new to Python dev), but it seems like that’s the preferred way of asking for help. Anyway, for the life of me, I cannot seem to get this to work. I’ve been working on this for hours now and reading everything I can find, but either nothing is working or I’m just not understanding it well enough to do it right. I’m hoping someone can point me in the right direction. Don’t be afraid to get remedial.
I’m running Sublime Text (build 3065) on OS X. Python 2.7.9 is installed via Homebrew and pylint was installed via pip install pylint. I’m working on a few scripts using Python 2.7 and they all begin with #!/usr/bin/env python.
Relevant Console Output
$ which python
/usr/local/bin/python
$ python --version
Python 2.7.9
$ which pylint
/usr/local/bin/pylint
$ pylint --version
No config file found, using default configuration
pylint 1.4.1,
astroid 1.3.4, common 0.63.2
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
SublimeLinter Settings (linters > pylint snippet)
"pylint": {
"@disable": false,
"@python": "2.7",
"args": [],
"disable": "",
"enable": "",
"excludes": [],
"paths": [],
"rcfile": "",
"show-codes": true
}
Sublime Console Output
startup time: 0.992911
launching: /Users/robwilkerson/Dropbox/Applications/Sublime Text.app/Contents/MacOS/plugin_host
loaded 1760 snippets
reloading plugin Default.block
reloading plugin Default.comment
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_file_settings
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin Vintage.vintage
Traceback (most recent call last):
File "/Users/robwilkerson/Dropbox/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 73, in reload_plugin
m = importlib.import_module(modulename)
File "./importlib/__init__.py", line 90, in import_module
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Users/robwilkerson/Dropbox/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 671, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/robwilkerson/Dropbox/Library/application_support/sublimetext3/Packages/Vintage/vintage.py", line 307
print "invalid motion mode:", mode
^
SyntaxError: invalid syntax
reloading plugin Vintage.vintage_commands
reloading plugin Vintage.vintage_motions
Traceback (most recent call last):
File "/Users/robwilkerson/Dropbox/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 73, in reload_plugin
m = importlib.import_module(modulename)
File "./importlib/__init__.py", line 90, in import_module
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Users/robwilkerson/Dropbox/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 671, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/robwilkerson/Dropbox/Library/application_support/sublimetext3/Packages/Vintage/vintage_motions.py", line 3, in <module>
from vintage import transform_selection
ImportError: No module named 'vintage'
reloading plugin 0_package_control_loader.00-package_control
reloading plugin 0_package_control_loader.02-bz2
reloading plugin Block Cursor Everywhere.SublimeBlockCursor
reloading plugin BracketHighlighter.bh_core
reloading plugin BracketHighlighter.bh_logging
reloading plugin BracketHighlighter.bh_plugin
reloading plugin BracketHighlighter.bh_regions
reloading plugin BracketHighlighter.bh_remove
reloading plugin BracketHighlighter.bh_rules
reloading plugin BracketHighlighter.bh_search
reloading plugin BracketHighlighter.bh_swapping
reloading plugin BracketHighlighter.bh_wrapping
reloading plugin BracketHighlighter.ure
reloading plugin Colorsublime.colorsublime-plugin
reloading plugin Copy to HipChat.copy_to_hipchat
reloading plugin EditorConfig.EditorConfig
reloading plugin GitGutter.git_gutter
reloading plugin GitGutter.git_gutter_change
reloading plugin GitGutter.git_gutter_compare
reloading plugin GitGutter.git_gutter_events
reloading plugin GitGutter.git_gutter_handler
reloading plugin GitGutter.git_helper
reloading plugin GitGutter.view_collection
reloading plugin HTML5.encode_html_entities
reloading plugin HTML5.html_completions
reloading plugin Insert Callback.Callback
reloading plugin Local History.history
reloading plugin MarkdownEditing.bootstrap
reloading plugin MarkdownEditing.custom_find_under_expand
reloading plugin MarkdownEditing.distraction_free_mode
reloading plugin MarkdownEditing.footnotes
reloading plugin MarkdownEditing.gather_missing_links
reloading plugin MarkdownEditing.indent_list_item
reloading plugin MarkdownEditing.indent_list_multiitem
reloading plugin MarkdownEditing.insert_references
reloading plugin MarkdownEditing.jumpToMarker
reloading plugin MarkdownEditing.lint
reloading plugin MarkdownEditing.list_markdown_references
reloading plugin MarkdownEditing.numbered_list
reloading plugin MarkdownEditing.paste_as_link
reloading plugin MarkdownEditing.paste_as_reference
reloading plugin MarkdownEditing.quote_indenting
reloading plugin MarkdownEditing.underlined_headers
reloading plugin Package Control.bootstrap
reloading plugin Package Control.Package Control
reloading plugin Rsync SSH.rsync-ssh
reloading plugin RSync.RSync
reloading plugin ScopeHunter.scope_hunter
reloading plugin ScopeHunter.scope_hunter_notify
reloading plugin SideBarEnhancements.SideBar
reloading plugin SideBarEnhancements.SideBarAPI
reloading plugin SideBarEnhancements.SideBarDefaultDisable
reloading plugin sublime-github.commandline
reloading plugin sublime-github.github
reloading plugin sublime-github.sublime_github
reloading plugin sublime-github.sublime_requests
reloading plugin SublimeGit.SublimeGit
reloading plugin SublimeLinter-json.linter
SublimeLinter: json linter loaded
reloading plugin SublimeLinter-pylint.linter
SublimeLinter: pylint linter loaded
reloading plugin SyncedSideBar.SyncedSideBar
reloading plugin Tag.Edit
reloading plugin Tag.Tag
reloading plugin Tag.tag_classes
reloading plugin Tag.tag_close_tag
reloading plugin Tag.tag_close_tag_on_slash
reloading plugin Tag.tag_indent
reloading plugin Tag.tag_insert_as_tag
reloading plugin Tag.tag_lint
reloading plugin Tag.tag_remove
reloading plugin Tag.tag_remove_attributes
reloading plugin Vintage Escape.vintage_escape
reloading plugin Vintageous.__init__
reloading plugin Vintageous.dev_cmds
reloading plugin Vintageous.ex_commands
reloading plugin Vintageous.ex_main
reloading plugin Vintageous.ex_motions
reloading plugin Vintageous.jump_list_cmds
reloading plugin Vintageous.modelines
reloading plugin Vintageous.state
reloading plugin Vintageous.test_runner
reloading plugin Vintageous.xactions
reloading plugin Vintageous.xmotions
reloading plugin Vintageous.xsupport
reloading plugin Vintageous.xsupport_mouse
reloading plugin Alignment.Alignment
reloading plugin Default File Type.default_file_type
reloading plugin DocBlockr.__init__
reloading plugin DocBlockr.jsdocs
reloading plugin GenerateUUID.generate_uuid
reloading plugin Markdown Preview.helper
reloading plugin Markdown Preview.markdown_settings
reloading plugin Markdown Preview.markdown_wrapper
reloading plugin Markdown Preview.MarkdownPreview
reloading plugin Phpcs.phpcs
reloading plugin ReadmePlease.ReadmePlease
reloading plugin SmartMarkdown.headline
reloading plugin SmartMarkdown.headline_level
reloading plugin SmartMarkdown.headline_move
reloading plugin SmartMarkdown.pandoc_render
reloading plugin SmartMarkdown.smart_folding
reloading plugin SmartMarkdown.smart_list
reloading plugin SmartMarkdown.smart_table
reloading plugin SmartMarkdown.table
reloading plugin SmartMarkdown.utilities
reloading plugin SublimeCodeIntel.ordereddict
reloading plugin SublimeCodeIntel.SublimeCodeIntel
reloading plugin SublimeLinter.commands
reloading plugin SublimeLinter.sublimelinter
reloading plugin SublimeLinter-jshint.linter
SublimeLinter: jshint linter loaded
reloading plugin SublimeLinter-php.linter
SublimeLinter: php linter loaded
reloading plugin SublimeREPL.__init__
reloading plugin SublimeREPL.completions
reloading plugin SublimeREPL.lang_integration
reloading plugin SublimeREPL.run_existing_command
reloading plugin SublimeREPL.sublimerepl
reloading plugin SublimeREPL.sublimerepl_build_system_hack
reloading plugin SublimeREPL.text_transfer
plugins loaded
SublimeLinter: debug mode: on
SublimeLinter: temp directory: /var/folders/21/99c8gzcn7lz9dx__973hbj940000gn/T/SublimeLinter3-robwilkerson
SublimeLinter: find_python(version='3', script=None, module=None)
SublimeLinter: find_python: requested version = {'major': 3, 'minor': None}
SublimeLinter: user shell: /bin/zsh
SublimeLinter: computed PATH using /bin/zsh:
~/.nvm/v0.10.33/bin/
/usr/local/bin/
/Users/robwilkerson/.nvm/v0.10.33/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
SublimeLinter: find_posix_python: python3 => None
SublimeLinter: find_posix_python: python3 => None
SublimeLinter: find_posix_python: python => /usr/local/bin/python
SublimeLinter: find_python: system python = /usr/local/bin/python
SublimeLinter: find_python: available version = {'major': 2, 'minor': 7}
SublimeLinter: find_python: <= (None, None, 2, 7)
SublimeLinter: no python 3 available to augment sys.path
SublimeLinter: find_python(version=None, script='pylint', module=None)
SublimeLinter: find_python: default python = /usr/local/bin/python
SublimeLinter: find_python: available version = {'major': 2, 'minor': 7}
SublimeLinter: find_python: 'pylint' path = /usr/local/bin/pylint
SublimeLinter: find_python: <= ('/usr/local/bin/python', '/usr/local/bin/pylint', 2, 7)
SublimeLinter: pylint version query: /usr/local/bin/python /usr/local/bin/pylint --version
SublimeLinter: WARNING: no pylint version could be extracted from:
Traceback (most recent call last):
File "/usr/local/bin/pylint", line 11, in <module>
sys.exit(run_pylint())
File "/Library/Python/2.7/site-packages/pylint/__init__.py", line 22, in run_pylint
from pylint.lint import Run
File "/Library/Python/2.7/site-packages/pylint/lint.py", line 43, in <module>
import astroid
File "/Library/Python/2.7/site-packages/astroid/__init__.py", line 54, in <module>
from astroid.nodes import *
File "/Library/Python/2.7/site-packages/astroid/nodes.py", line 40, in <module>
from astroid.node_classes import Arguments, AssAttr, Assert, Assign, \
File "/Library/Python/2.7/site-packages/astroid/node_classes.py", line 23, in <module>
import six
ImportError: No module named six
SublimeLinter: found existing HTML syntax, version 3
found 57 files for base name Main.sublime-menu
SublimeLinter: found existing Rails syntax, version 1
Package Control: No updated packages
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 15 (5 by maintainers)
Ran into same issue myself having installed
python,pipandpylintvia Homebrew. As such, the paths to the executables in my python environment were:python:/usr/local/bin/python->/usr/local/Cellar/python/2.7.12_1/bin/python(symlink)pylint:/usr/local/bin/pylintpip:/usr/local/bin/pip->/usr/local/Cellar/python/2.7.12_1/bin/pip(symlink)Although my
PATHandPYTHONPATHsettings were correct to prefer the Homebrewpythonenvironment paths, there was one problem:pylintexecutable shim had a shebang line at the top (#!/usr/local/opt/python/bin/python2.7which pointed to OSXPython.frameworkpath:/usr/local/opt/python/bin/python2.7->/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/bin/python2.7), it was somehow causing a conflict with the runtime environment ofpylintand overriding the Homebrew python.In order to check how the Pylinter Sublime Text Package was starting
pylint, I added a couple debug lines into thePylintercode to check what it was using forpython_bin, andpylint_path:The error message in Sublime Text console was:
Solution:
Because I preferred Homebrew for managing my
pythonandpipversions, I edited the shim file and replaced the shebang line at the top with:#!/usr/local/bin/pythonto force the Homebrew python. Alternatively, it looks like I could have setpylint_pathin my Sublime Text settings somewhere, but I could not get this to work (maybe I did not use the correct setting json variable name or type?).After the fix, I quit and restarted Sublime Text 3, and in the console, it found
pylintfine this time withoutpylint_pathset: