kylebarron / stata_kernel

A Jupyter kernel for Stata. Works with Windows, macOS, and Linux.
https://kylebarron.dev/stata_kernel/
GNU General Public License v3.0
266 stars 57 forks source link

Atom and stata_kernel togther with Hydrogen -- not executing #411

Closed nikhiloncode closed 2 years ago

nikhiloncode commented 2 years ago

Problem description

When I run Hydrogen in atom and try to execute the STATA command using Hydrogen--> run it shows an error given below

Debugging log

If possible, attach the text file located at

Stata

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 166, in read_nonblocking s = os.read(self.child_fd, size) OSError: [Errno 5] Input/output error

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 111, in expect_loop incoming = spawn.read_nonblocking(spawn.maxread, timeout) File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 485, in read_nonblocking return super(spawn, self).read_nonblocking(size) File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 171, in read_nonblocking raise EOF('End Of File (EOF). Exception style platform.') pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.8/dist-packages/stata_kernel/main.py", line 4, in IPKernelApp.launch_instance(kernel_class=StataKernel) File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 663, in launch_instance app.initialize(argv) File "", line 2, in initialize File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 87, in catch_config_error return method(app, args, **kwargs) File "/usr/lib/python3/dist-packages/ipykernel/kernelapp.py", line 562, in initialize self.init_kernel() File "/usr/lib/python3/dist-packages/ipykernel/kernelapp.py", line 439, in init_kernel kernel = kernel_factory(parent=self, session=self.session, File "/usr/lib/python3/dist-packages/traitlets/config/configurable.py", line 412, in instance inst = cls(args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/stata_kernel/kernel.py", line 71, in init self.stata = StataSession(self) File "/usr/local/lib/python3.8/dist-packages/stata_kernel/stata_session.py", line 94, in init self.init_console() File "/usr/local/lib/python3.8/dist-packages/stata_kernel/stata_session.py", line 190, in init_console self.child.expect(self.prompt, timeout=0.2) File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 340, in expect return self.expect_list(compiled_pattern_list, File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 369, in expect_list return exp.expect_loop(timeout) File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 117, in expect_loop return self.eof(e) File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 63, in eof raise EOF(msg) pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.

<pexpect.pty_spawn.spawn object at 0x7f0f1144cfd0> command: /usr/local/stata17/stata-mp args: [b'/usr/local/stata17/stata-mp'] buffer (last 100 chars): '' before (last 100 chars): 'License not applicable to this Stata\r\n' after: match: None match_index: None exitstatus: None flag_eof: True pid: 237577 child_fd: 73 closed: False timeout: 30 delimiter: logfile: <_io.TextIOWrapper name='/home/nikhilpm/.stata_kernel_cache/console_debug.log' mode='w' encoding='utf-8'> logfile_read: None logfile_send: None maxread: 2000 ignorecase: False searchwindowsize: None delaybeforesend: None delayafterclose: 0.1 delayafterterminate: 0.1 searcher: searcher_re: 0: re.compile('\r\n\. ')

#### Code Sample

sysuse auto

Expected Output

Other information

If you didn't attach the debugging log, please provide:

kylebarron commented 2 years ago

License not applicable to this Stata

You should verify this. You should be able to run /usr/local/stata17/stata-mp in a terminal and work with stata normally

nikhiloncode commented 2 years ago

License not applicable to this Stata

I get this message when I run/usr/local/stata17/stata-mp However, I generally runxstatacommand to run STATA and I checked my license and it is valid till September NEXT year. I also tried to change the permission of the license file as mentioned in the STATA manual but the problem persists.

kylebarron commented 2 years ago

I get this message when I run/usr/local/stata17/stata-mp

I think regardless that means it's out of control of stata-kernel. You might have multiple copies of Stata on your machine or something, but it's not likely a bug in stata-kernel.

nikhiloncode commented 2 years ago

Ah! Ok. Thank you for your time and patience.