sublime-text-isort-plugin icon indicating copy to clipboard operation
sublime-text-isort-plugin copied to clipboard

isort doesn't load: ValueError: Attempted relative import in non-package

Open tdhopper opened this issue 9 years ago • 2 comments

I'm seeing this in my console when I start ST2:

Reloading plugin /Users/tdhopper/Library/Application Support/Sublime Text 2/Packages/isort/isort_file.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./isort_file.py", line 9, in <module>
    from .isort import SortImports
ValueError: Attempted relative import in non-package

tdhopper avatar Apr 23 '15 13:04 tdhopper

i've changed the import on isort_file.py to from isort import SortImports and it worked properly.

haruanm avatar Feb 01 '16 03:02 haruanm

I've done the same as @haruanm with similar success with ST2 on Windows 8.1. Would be nice to make this work correctly by renaming the isort plugin module to not have the same name as the main isort package, though

jcb91 avatar Dec 05 '16 16:12 jcb91