9

I have recently installed Beaker Notebook but cannot get it to start Python.

I have an existing installation of Python, which I installed using Anaconda (which is actually recommended for Beaker). I have edited beaker.pref.json to point to my installation (see below), but it just won't start. Jupyter Notebook and other Python implementations work fine, so I know my installation is intact. My beaker.pref.json looks like this following these instructions:

{
  "autocomplete-parameters" : "true",
  "pref-format" : "1",
  "allow-anonymous-usage-tracking" : false,
  "languages" : {
    "IPython" : {
      "path" : "/Users/user/anaconda/bin"
    },
    "Python3" : {
      "path" : "/Users/user/anaconda/bin"
    },
    "Julia" : {
      "path" : "/Applications/Julia-0.6.app/Contents/Resources/julia/bin"
    }
  },
  "edit-mode" : "default"
}

which ipython returns /Users/user/anaconda/bin/ipython

which python3 returns /Users/user/anaconda/bin/python3

Here is what the error message looks like:

enter image description here

I cannot seem to figure out what I am doing wrong. Any help would be greatly appreciated!

EDIT: Jupyter notebook works just fine for Python and Julia alike, so I don't think there's anything wrong with these installations per se.

EDIT: The problems with Python may be resolved by installing Python using Anaconda. However, for Julia this does not seem to be so straightforward. Despite pointing Beaker to the location of the Julia executables, it fails to start the kernel.

Constantin
  • 629
  • 1
  • 7
  • 22

1 Answers1

4

On the link that you provide, the author recommends to use this:

"path": "/Users/user/anaconda/envs/py3k/bin"

as your Python3 path.

EDIT 1:

Then you can try and install python3 and IPython manually and link those to the preferences json.

EDIT 2:

In this issue the problem was resolved by the following:

Looks like it's caused by a perhaps previous ipkernel install for a homebrew installed python. Following command fixed the problem:

python -m ipykernel install --user Installed kernelspec python2 in
/Users/admin/Library/Jupyter/kernels/python2
John Moutafis
  • 22,254
  • 11
  • 68
  • 112
  • Unfortunately, this does not help. The same error message appears. The `envs` directory doesn't contain a py3k folder. I'm not sure why this is because I installed Python via Anaconda, and this is recommended for Beaker. – Constantin Feb 23 '17 at 22:33
  • Should I install python3 and IPython manually despite anaconda being recommended? Can't I somehow get the python3 installation into the `envs` directory using anaconda? If not, how can I get it there manually? – Constantin Feb 24 '17 at 16:46
  • in your terminal: `conda create -n py3k python=3.5 anaconda` that should create a folder in envs named py3k with the pythone.5 installed. I recommend to name the folder py35 instead of py3k so in the future if you want to install say version 3.6 you will create a new folder, py36. Also if you are on Linux, you must `source activate py3k` – John Moutafis Feb 25 '17 at 12:27
  • No success with that, unfortunately. Same error message appears. – Constantin Feb 25 '17 at 16:49
  • I am not sure, because i do not have a Mac, but you may have to `source activate py3k` as well... – John Moutafis Feb 25 '17 at 18:13
  • I have tried that as well. I'm really not sure what the problem could be. The way I understand it, as long as `beaker.pref.json` points to a working installation it should work... – Constantin Feb 25 '17 at 18:19
  • Yes i believe that your understanding is correct. That said, try to install the official Python3 to your computer and point breaker to that installation... – John Moutafis Feb 25 '17 at 18:46
  • That's what I did; the Python3 installation works fine on its own, but Beaker doesn't seem to recognise it for some reason. – Constantin Feb 25 '17 at 22:08
  • Well that may sound detrimental from my part... But have you tried to uninstall Beaker and reinstall it? (cliche) – John Moutafis Feb 26 '17 at 13:09
  • I have done clean re-installs of both Python3, Julia (which I'm also trying to get to work with Beaker), and Beaker itself. Without success. And I can't find anything on it online. I have no idea what to do. – Constantin Feb 26 '17 at 23:38
  • Mysteriously, http://beakernotebook.com/getting-started doesn't even mention editing the `.json` file to get it to work with Julia; and yet it doesn't work with Julia either. – Constantin Feb 26 '17 at 23:43
  • I read a bit around and there maybe a possibility... You may need to fidle around eith your PYTHONPATH to point it to the anaconda's (or Julia's) installation... – John Moutafis Feb 27 '17 at 10:04
  • Python itself doesn't work either, though. The problem arises only with Beaker, though. With Jupyter notebook both Python and Julia work just fine. – Constantin Feb 28 '17 at 02:03
  • 1
    see this issue https://github.com/twosigma/beaker-notebook/issues/5008 if that fixes your problem i will edit my response to match the solution – John Moutafis Feb 28 '17 at 08:30
  • I'm having almost exactly the same issue. Was there any solution? – quantif Jun 22 '17 at 01:53
  • It's still not resolved for me. Especially Julia seems very problematic to set up with Beaker... – Constantin Jun 30 '17 at 10:59
  • Hey @Constantin I was passing through my answers. Did you find a solution on this? Was my answer helpful? – John Moutafis Aug 11 '17 at 10:05
  • Unfortunately, the problem persists. I have followed your suggestion and even installed beaker on a new device. The problem continues to occur. – Constantin Aug 11 '17 at 11:37