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

Issues with stata_kernel in Atom (Hydrogen) #414

Open
StaffanBetner opened this issue Feb 1, 2022 · 3 comments
Open

Issues with stata_kernel in Atom (Hydrogen) #414

StaffanBetner opened this issue Feb 1, 2022 · 3 comments

Comments

@StaffanBetner
Copy link

Problem description

I am having troubles importing the kernel in Atom. It works fine in Jupyter!

Debugging log

I get this traceback in Atom (user name redacted):

Traceback (most recent call last):
  File "C:\Users\xx\Miniconda3\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\xx\Miniconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\xx\Miniconda3\lib\site-packages\stata_kernel__main__.py", line 2, in 
    from . import StataKernel
ImportError: cannot import name 'StataKernel' from 'stata_kernel' (C:\Users\xx\Miniconda3\lib\site-packages\stata_kernel__init__.py)

Other information

  • Operating System
    Windows 10
  • Stata version
    Stata/SE 14
  • Package version (You can find this by running pip show stata_kernel in your terminal.)
    1.12.2-py39hcbf5309_1
  • Hydrogen version
    2.16.3
  • Atom version
    1.58.0
@kylebarron
Copy link
Owner

kylebarron commented Feb 1, 2022

If it works fine in Jupyter, that means the Python environment that Atom is using is different from the global one that Jupyter is using. In that case, the easiest workaround is to set environment variables in your terminal before launching Atom, so that it's pointign to the same Python as Jupyter. You should be able to verify they're the same by making sure import sys; sys.executable is the same in both Python environments. Then if stata_kernel works in one it should also work in the other.

@StaffanBetner
Copy link
Author

StaffanBetner commented Feb 2, 2022

It is the same Python environment. I have setup an R kernel as well which works in both Jupyter and Atom. This seems to be the same error: nteract/hydrogen#2126

@StaffanBetner
Copy link
Author

After starting Atom within the Anaconda prompt it works. So you were right in some way. Need to figure out how!

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

2 participants