Closed iNaD closed 11 years ago
I experienced the exact same issue running Windows, Sublime Text 2 and WakaTime. The issue that you are experiencing is that python cannot be found. Make sure that you have python 2.7 installed (Wakatime didnt work nicely with Python 3.3) and that the python directory is in your Windows path.
Additionally, Alan fixed various issues so you should ensure that you have the latest version of the plugin via:
Hopefully that resolves your issue!
Edit: Haha you've been faster than me ;) Yea I tried to fix it for Python 3.x, but there are too many old dependencies which have to be replaced or refactored, so I decided to install Python 2.x.
Old comment:
Ok so I have installed python now the error doesn't appear. Maybe this should be mentioned in the Readme for Windows users (It's not natural for Win users to have python installed and in PATH). Isn't it possible to use Sublime Text's python to execute the commands? I'm not familiar with Sublime Text plugin development, so I'm not sure about this.
Yours Daniel
I agree with you. Unfortunately, I am also not familiar with plugin development but it seems like it would be a nice addition! If not possible, then a mention of having Python in the PATH in the readme should be enough.
Glad it worked! I've been using the plugin for two days and I love it :)
Hehe :+1: You could have same try-error cases to maintain a Python 2.x and 3.x version, but that would be too much hassle to maintain. If it uses the integrad python compiler of Sublime Text you don't have to worry about Python versions and stuff.
@iNaD so this error is fixed in the current plugin version?
@alanhamlett Yes, it wasn't an error in your code, it was the fact that Python wasn't in the PATH
Awesome! I'll close the issue now.
Should I make instructions for Windows Users as pull request? (My english is not the best, but I will to correct my mistakes as good as I can)
I can use sys.executable
to set the python path for the subprocess command.
That executes / uses the integrated python of st? If so, then it would be good to use it. As I mentioned before, not every Win user got python runtime installed =]
Yes, on Windows it would return the ST embedded python interpreter.
Although I'm not sure if Windows needs to use pythonw to prevent a GUI window opening.
After saving there's no GUI window opening with pythonw, but still the cursor turns into a spinning cursor while the subprocess is running. Maybe it's also fixed by using the embedded interpreter.
@iNaD after testing, ST returns python3
from sys.executable so that's not going to work because an absolute path is needed.
Commit 998d0b2066 trys to execute python and then looks for python.exe in C:\python* This will work if Windows users install Python to the default path.
Hmm default path of the python installer is C:\pythonXX
where XX
is the version number (ex. Python 2.7 defaults to C:\Python27
But thanks anyway you tried to solve this. I know it's not easy to handle dependencies like this on Windows without delivering it with your application.
@iNaD C:\python27 would be picked up by the glob C:\python* then the plugin will look for python.exe inside C:\python27 so this should fix the issue.
The last sentence is (translated) something like: The system can't find the given file
So WakaTime isn't tracking any time :( I hope you know a fix or can find a fix. I will have a look into the plugin.