thijsdezoete / sublime-text-isort-plugin

A python import sort plugin(See https://github.com/timothycrosley/isort)
25 stars 24 forks source link

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

Open tdhopper opened 9 years ago

tdhopper commented 9 years ago

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
haruanm commented 8 years ago

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

jcb91 commented 7 years ago

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