Saturday 23 October 2021

Setting up Hydrogen and Atom with Anaconda on Windows

I would like to run python interactively in ATOM using the Hydrogen package. I would like to be able to initiate an ATOM session by double-clicking the ATOM icon in my toolbar or double-clicking a .py file and not have to resort to initiating ATOM via the command line. I am on Windows 10. I have installed Python 3.8 via the Anaconda distribution. I have used pip install to install the ipykernel.

I get a series of Traceback errors which seems to be common;

Traceback (most recent call last): File "C:\Users\BRB\anaconda3\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\BRB\anaconda3\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\BRB\anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in from ipykernel import kernelapp as app File "C:\Users\BRB\anaconda3\lib\site-packages\ipykernel__init__.py", line 2, in from .connect import File "C:\Users\BRB\anaconda3\lib\site-packages\ipykernel\connect.py", line 18, in import jupyter_client File "C:\Users\BRB\anaconda3\lib\site-packages\jupyter_client__init__.py", line 4, in from .connect import File "C:\Users\BRB\anaconda3\lib\site-packages\jupyter_client\connect.py", line 21, in import zmq File "C:\Users\BRB\anaconda3\lib\site-packages\zmq__init__.py", line 47, in from zmq import backend File "C:\Users\BRB\anaconda3\lib\site-packages\zmq\backend__init__.py", line 40, in reraise(*exc_info) File "C:\Users\BRB\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise raise value File "C:\Users\BRB\anaconda3\lib\site-packages\zmq\backend__init__.py", line 27, in _ns = select_backend(first) File "C:\Users\BRB\anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend mod = import(name, fromlist=public_api) File "C:\Users\BRB\anaconda3\lib\site-packages\zmq\backend\cython__init__.py", line 6, in from . import (constants, error, message, context, ImportError: DLL load failed while importing error: The specified module could not be found.

Things I have tried:

  1. I first added the Python3 executable to the system PATH (against the advice of Anaconda). This does work if I initiate ATOM via the command line, but if I double-click the ATOM icon or .py file, I get the usual traceback errors.

This answer https://discuss.atom.io/t/solved-how-to-use-the-hydrogen-package/30190 says it was a problem with Atom on macOS machines on older versions of Atom but has since been corrected for macOS. The answer was 4 years ago, so I assume it has been corrected for Windows, but I cannot find a soltion.

  1. This answer Setting up Hydrogen and Atom with Anaconda managing python installation says to (A) run:

    conda activate myenv python -m ipykernel install --user

and (B) clean up the PATH.

I did do both of these things. Removing the Python3 executable from PATH was a step backwards. Now it doesn't work even from the command line. I also don't understand why this is even bad in the first place...

  1. This guy Atom: Setting up Hydrogen Launcher for use with Python 3.7 has the same problems. But no solution.

Can someone point me in the right direction?

I am relatively new so would prefer not to complicate things by setting up multiple virtual environments etc at this stage (I don't yet have a need and I want simple).



from Setting up Hydrogen and Atom with Anaconda on Windows

No comments:

Post a Comment