Reputation: 15136
I am trying to find some package that would auto format python code when using sublime.
There is PythonTidy, but when I use PackageController it says install completed but the package is not installed (does not appear in preferences).
I did try following the instructions in: https://github.com/witsch/SublimePythonTidy
and while i "pip installed" the package in python, sublime would not load, throwing:
terminate called after throwing an instance of 'boost::python::error_already_set'
/usr/bin/subl: line 3: 12415 Aborted
/usr/lib/sublime-text-2/sublime_text --class=sublime-text-2 "$@"
How would I go about installing this without PackageController, or alternatively, can anyone recommend another package?
Upvotes: 19
Views: 47673
Reputation: 167
ctrl+shift+P then Package Control: Install Package
Look for Python PEP8 Autoformat
and install it.
Upvotes: 14
Reputation: 8037
Try doing the following in command line (a bit brute force):
Packages/PythonTidy
folder,~/.config/sublime-text-2/Packages/PythonTidy
~/.config/sublime-text-2/Packages/SublimePythonTidy
Package Control
PythonTidy
folder (which in your case will be empty).git clone https://github.com/witsch/PythonTidy.git
View
-> Show Console
)P.S.
If you are unable to start Sublime
do a:
sudo pip uninstall PythonTidy
Then retry what I wrote above.
Upvotes: 8
Reputation: 13373
Package Control should create an appropriately named folder in Sublime Text's packages folder. You can get there from Preferences > Browse Packages
. If the package installed correctly, there should be a folder called PythonTidy. If there's not, you can download the package from github directly and place the folder in this Packages folder.
Upvotes: 1