Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Stata's version? #47

Open
alinemsm opened this issue Aug 7, 2016 · 12 comments
Open

Problem with Stata's version? #47

alinemsm opened this issue Aug 7, 2016 · 12 comments

Comments

@alinemsm
Copy link

alinemsm commented Aug 7, 2016

Hi,

I'm getting the error below when sending a line to Stata. I'm using Stata 13.1 in Mac OSX.

Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./text_2_stata.py", line 168, in run
  File "./text_2_stata.py", line 54, in get_stata_version
ValueError: zero length field name in format

Thank you!

@elbersb
Copy link
Contributor

elbersb commented Aug 8, 2016

Does this happen with any line? What version of Stata do you have (StataMP, StataSE, etc.)?

@alinemsm
Copy link
Author

alinemsm commented Aug 8, 2016

I have Stata/IC 13.1. It was working fine before the latest package update. Yes, it happens with whatever line I run.

@elbersb
Copy link
Contributor

elbersb commented Aug 9, 2016

It seems to be an error with your python version. Can you run
import sys; print(sys.version)
in your sublime console?

@alinemsm
Copy link
Author

alinemsm commented Aug 9, 2016

I get

>>> import sys; print(sys.version) 2.6.9 (unknown, Oct 23 2015, 19:19:20) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]
But I do have the latest python version installed. Can I point sublime to the other version?

@elbersb
Copy link
Contributor

elbersb commented Aug 9, 2016

I don't know how to change the python version in Sublime, but it's very easy to fix, and this way we can support Python 2.6 again. Please see this file: https://github.com/elbersb/SublimeStataEnhanced/blob/master/text_2_stata.py
You can manually replace your local file with this file and then it should work again.

@andrewheiss I made a pull request for this.

@alinemsm
Copy link
Author

alinemsm commented Aug 9, 2016

@elbersb thanks for this!

I've done as you said and am getting

Unknown macro command text_2_stata

@elbersb
Copy link
Contributor

elbersb commented Aug 10, 2016

I can't possibly understand how this change produces this error message...
Which version of Sublime are you using? I think in Sublime 3, Python 3 is used by default.

@alinemsm
Copy link
Author

Sorry about the late reply. I use Sublime Text 2.
I did a clean install in ST2 and the plugin and replaced the text_2_stata.py file by yours.
Now am getting something similar to the previous error.

Writing file /Users/Al/Library/Application Support/Sublime Text 2/Packages/Stata Enhanced/text_2_stata.py with encoding UTF-8
Reloading plugin /Users/Al/Library/Application Support/Sublime Text 2/Packages/Stata Enhanced/text_2_stata.py
Writing file /Users/Al/Library/Application Support/Sublime Text 2/Packages/Stata Enhanced/text_2_stata.py with encoding UTF-8
Reloading plugin /Users/Al/Library/Application Support/Sublime Text 2/Packages/Stata Enhanced/text_2_stata.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./text_2_stata.py", line 168, in run
  File "./text_2_stata.py", line 86, in get_stata_version
AttributeError: 'module' object has no attribute 'check_output'

@elbersb
Copy link
Contributor

elbersb commented Aug 19, 2016

This error is again related to the old Python version. It would be nice to support Python 2.6 completely, but I can't take care of this right now. If it's not possible to switch to Sublime 3, then maybe the easiest way is to install the old version of the plugin?

@alinemsm
Copy link
Author

I am now using Sublime 3 and the plugin works well. Many thanks for your help!

@elbersb
Copy link
Contributor

elbersb commented Aug 19, 2016

Great!
@andrewheiss Do you want to support Sublime 2? If not, this can be closed.

@uttara-cmu
Copy link

Can Stata Enhanced be used on Sublime Text 2 on Mac? Cmd + enter doesn't respond when I try executing the outside stata. I use StataMP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants