SublimePythonTidy icon indicating copy to clipboard operation
SublimePythonTidy copied to clipboard

ImportError: No module named PythonTidy

Open miohtama opened this issue 13 years ago • 4 comments

SublimePythonTidy seems to depend on PythonTidy, but does not support instructions how to configure one.

This shows on console when trying to execute PythonTidy

Reloading plugin /Users/moo/Library/Application Support/Sublime Text 2/Packages/PythonTidy/Tidy.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./Tidy.py", line 17, in <module>
ImportError: No module named PythonTidy

OSX Lion

miohtama avatar Jun 26 '12 22:06 miohtama

Ah, my guess is that Package Control installation is broken for SublimePythonTidy, because it referes to external Git repo.

I suggest either to fix or disable Package Control installation method.

miohtama avatar Jun 26 '12 22:06 miohtama

Package Control currently doesn't support git submodules: wbond/sublime_package_control#126

You could create a custom package or just include PythonTidy in the repo

// @witsch

sindresorhus avatar Jul 31 '12 16:07 sindresorhus

Hi,

Same problem here. To solved it, I did the following:

1.- Downloaded https://github.com/witsch/PythonTidy/archive/master.zip and put the files inside the master folrder in the Packages/PythonTidy/PythonTidy folder

2.- Edited Packages/PythonTidy/Tidy.py and commented the following lines:

if not exists(join(extra, '.git')): call(['git', 'submodule', 'init']) call(['git', 'submodule', 'update'])

Hope this helps.

jfroco avatar May 20 '13 23:05 jfroco

It should also make sense to check call() return value so we can detect the condition when use has no git command installed and we can show a message telling user to install command-line git first

miohtama avatar May 21 '13 10:05 miohtama