thijsdezoete / sublime-text-isort-plugin

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

ImportError: cannot import name SortImports #2

Open vbabiy opened 11 years ago

vbabiy commented 11 years ago

I get this error when installing it in sublime 3

reloading plugin isort.isort_file
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 73, in reload_plugin
    m = importlib.import_module(modulename)
  File "X/importlib/__init__.py", line 88, in import_module
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "isort_file in /Users/vbabiy/Library/Application Support/Sublime Text 3/Installed Packages/isort.sublime-package", line 3, in <module>
ImportError: cannot import name SortImports
reloading plugin isort.ordereddict
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 73, in reload_plugin
    m = importlib.import_module(modulename)
  File "X/importlib/__init__.py", line 88, in import_module
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "ordereddict in /Users/vbabiy/Library/Application Support/Sublime Text 3/Installed Packages/isort.sublime-package", line 23, in <module>
ImportError: No module named 'UserDict'
thijsdezoete commented 11 years ago

Hi, thanks for reporting. @jpotterm is working on it

dougwt commented 10 years ago

Any progress on this error? I am getting the same thing in Sublime Text 3.

thijsdezoete commented 10 years ago

Hi @dougwt no, not at all actually. Sorry for not reporting that back. You're welcome to provide the fix yourself? :)

dougwt commented 10 years ago

@thijsdezoete I've submitted a pull request with my proposed fixes: https://github.com/thijsdezoete/sublime-text-isort-plugin/pull/11

Cheers!

dougwt commented 10 years ago

I'm not 100% sure how package control works... does a new version tag need to be created? It seems to still be installing the old version from Package Control.

thijsdezoete commented 10 years ago

@dougwt Hm, last time I merged something, when I reinstalled, it was just the new version. I never really took the time to properly solve the versioning/tagging thing, I can have a look this Wednesday if you like.

dougwt commented 10 years ago

@thijsdezoete I think all that might be required is to tag the merged version as release 0.0.4

thijsdezoete commented 10 years ago

@dougwt Ah, ok, I pushed a new tag 0.0.4 now

dougwt commented 10 years ago

@thijsdezoete Sorry, it looks like I may have been mistaken about the tag thing. However, now that I know Package Control was installing the latest version, I've gone back to the docs and it looks like the issue might be caused due to the way Package Control packages its plugins. I've submitted a pull request (#12) that includes a file telling Package Control not to package the plugin. Hopefully that solves the issue!

thijsdezoete commented 10 years ago

@dougwt did it?

dougwt commented 10 years ago

@thijsdezoete I was still getting the ImportError after all of that. However, since the plugin was installed to a directory I was able to edit it directly until finding an import statement that works. (#13) I'm not sure if the .no-sublime-package is required at this point, but hopefully this should return the plugin to working order.

thijsdezoete commented 10 years ago

@dougwt Ok, so could we add that one to the repo, and then get this over with? I really appreciate the time you're taking to get this done! :)

dougwt commented 10 years ago

You're quite welcome. Please accept Pull Request #13 and we'll see if that works!

dougwt commented 10 years ago

Everything seems to be working in Sublime Text 3 at last :+1: