3

The default version of python installed on my mac is python 2. I also have python 3 installed but can't install python 2.

I'd like to configure Hyrdrogen on Atom to run my script using python 3 instead.

Does anybody know how to do this?

Ismael Padilla
  • 5,246
  • 4
  • 23
  • 35
ExpertShaun
  • 51
  • 1
  • 4

2 Answers2

1

Try running jupyter kernelspec list --json to view the current kernels installed on your machine. The python3 kernelspec argv key should have a valid path to your Python 3 executable. If it does not, you need to modify your kernel to point to the correct executable.

Instead of manually editing the kernelspec, I'd recommend reinstalling the kernel using one of the commands described here, depending on whether you use conda, virtualenv, or no virtual environment.

Also, make sure to start atom from a terminal using atom ., as they recommend in the atom docs, to ensure that atom has the same environment as your terminal.

  • Yes, Python 2.7 is the version it points to when I enter my terminal and type 'python'. How do I change it so that the default version is python 3? – ExpertShaun May 14 '18 at 19:37
  • @ExpertShaun I updated my comment some. You should google "how to add python 3 to path" since it varies by system and there are tons of tutorials on that kind of thing. – Ben Russert May 16 '18 at 00:19
  • 2
    This isn't a PATH setting... You should rather edit the kernel that Hydrogen is using – OneCricketeer May 16 '18 at 00:20
0

I used jupyter kernelspec list and I found 2 kernels available, one for python2 and another for python3

So I pasted python3 kernel folder in the same directory where python2 ken=rnel is installed and removed python2 kernel using 'rm -rf python2'

Rajat Jog
  • 197
  • 1
  • 10