tkf / emacs-ipython-notebook

IPython notebook client in Emacs
tkf.github.com/emacs-ipython-notebook/
GNU General Public License v3.0
548 stars 51 forks source link

Opening notebook with inline image result in error: ERROR:root:First ws message didn't have the form 'identity:[cookie]' - '' #121

Closed fzhang00 closed 11 years ago

fzhang00 commented 11 years ago

Hi,

I had ein 20130611 installed on EMACS 24.3.1 through "marmalade, on 64 bit Windows 7.

When I open a notebook with inline plots, I got the following messages and the notebook would not open in emacs:

Contacting host: 127.0.0.1:8888 [2 times] ein: [info] Kernel started: 15675e06-3ac6-455e-9417-183fb739e352 ein: [info] Starting WS: "ws://127.0.0.1:8888/kernels/15675e06-3ac6-455e-9417-183fb739e352" ein: [info] Unknown event: status_busy.Kernel [2 times] ein: [info] Unknown event: status_idle.Kernel ein: [info] Unknown event: execution_count.Kernel ein: [info] Unknown event: status_idle.Kernel

On the ipython notebook server side, it says

ERROR:root:First ws message didn't have the form 'identity:[cookie]' - '' 2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Notebook without images would open, but server side displays the same error message.

My installed packages are

python 2.7.5 ipython 1.0-dev pyzmq==13.1.0 tornado==3.1

Any idea which package this error is related to? I had the same configuration on a 32 bit machine, and it works fine. Also the browser interface works fine for the notebook. But I would really like to get the Emacs bit working.

Thanks in advance for any tip.

Fan

tkf commented 11 years ago

Please use M-x ein:dev-bug-report-template to write a bug report.

EvanMisshula commented 11 years ago

For what it is worth...It is working for me. Emacs version 24.3.1 and ein-20130611.1651/

Python packages ampl - 0.1 - active ipdb - 0.7 - active ipython - 0.13.2 - active matplotlib - 1.2.1 - active nose - 1.3.0 - active numpy - 1.7.1 - active pandas - 0.11.0 - active pip - 1.3.1 - active python-dateutil - 2.1 - active pytz - 2013b - active pyzmq - 13.1.0 - active readline - 6.2.4.1 - active scipy - 0.12.0 - active setuptools - 0.6c11 - active six - 1.3.0 - active sympy - 0.7.2 - active tornado - 3.0.2 - active wsgiref - 0.1.2 - active development (/home/evan/.pythonbrew/pythons/Python-2.7.3/lib/python2.7) yolk - 0.4.3 - active youtube-dl - 2013.06.21 - active

Best, Evan

On Fri, Jul 5, 2013 at 10:38 AM, Takafumi Arakaki notifications@github.comwrote:

Please use M-x ein:dev-bug-report-template to write a bug report.

— Reply to this email directly or view it on GitHubhttps://github.com/tkf/emacs-ipython-notebook/issues/121#issuecomment-20522133 .

Evan Misshula Doctoral Student (Criminal Justice) CUNY John Jay "Let us reform our schools, and we shall find little reform needed in our prisons." John Ruskin, Unto This Last, essay 2 (1862) English critic, essayist, & reformer (1819 - 1900)

"Instruction does much, but encouragement does everything." Johann Wolfgang Von Goethe www.snrg-nyc.org

fzhang00 commented 11 years ago

Here is the bug report.

Check list

Description of the problem you have

When I open a notebook with inline plots, I got the following messages and the notebook would not open in emacs:

Contacting host: 127.0.0.1:8888 [2 times] ein: [info] Kernel started: 15675e06-3ac6-455e-9417-183fb739e352 ein: [info] Starting WS: "ws://127.0.0.1:8888/kernels/15675e06-3ac6-455e-9417-183fb739e352" ein: [info] Unknown event: status_busy.Kernel [2 times] ein: [info] Unknown event: status_idle.Kernel ein: [info] Unknown event: execution_count.Kernel ein: [info] Unknown event: status_idle.Kernel

On the ipython notebook server side, it says

ERROR:root:First ws message didn't have the form 'identity:[cookie]' - '' 2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Notebook without images would open, but server side displays the same error message. Running zeroein.el according to the quick try instruction result in the same error

My installed packages are

python 2.7.5 ipython 1.0-dev pyzmq==13.1.0 tornado==3.1

Steps to reproduce the problem

On Windows 7 Pro x64

  1. Install winPython 2.7.5 for windows 64 bit, and register it to Windows
  2. Install ipython 1.0 dev from github $> git clone --recursive git://github.com/ipython/ipython.git $> cd ipython $> python setup.py install
  3. Start ipython notebook by ipython notebook
  4. In Emacs, M-x ein:notebooklist-open Then click the [open] link in the notebook list ERROR:root:First ws message didn't have the form 'identity:[cookie]' - '' 2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Expected output

For notebook with saved inline plots, it would not open in emacs. Minibuffer shows Contacting host: 127.0.0.1:8888 [2 times] ein: [info] Kernel started: 15675e06-3ac6-455e-9417-183fb739e352 ein: [info] Starting WS: "ws://127.0.0.1:8888/kernels/15675e06-3ac6-455e-9417-183fb739e352" ein: [info] Unknown event: status_busy.Kernel [2 times] ein: [info] Unknown event: status_idle.Kernel ein: [info] Unknown event: execution_count.Kernel ein: [info] Unknown event: status_idle.Kernel In ipython notebook server, it shows ERROR:root:First ws message didn't have the form 'identity:[cookie]' - '' 2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Your EIN configuration (in .emacs.d/init.el or somewhere else)

; use ein (require 'request) (require 'ein)

Your IPython configuration

  1. What is your IPython version? (run ipython --version): ipython 1.0-dev
  2. How do you start IPython? (e.g., ipython notebook --port 9999): on command prompt: ipython notebook
  3. What is your IPython notebook port number or URL?: 8888

Additional information (if any)

System info:

("EIN system info"
 :emacs-version "GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)
 of 2013-03-17 on MARVIN"
 :emacs-bzr-version nil
 :window-system w32
 :emacs-variant nil
 :os
 (:uname nil
         :lsb-release nil)
 :image-types
 (png gif tiff jpeg xpm xbm pbm)
 :image-types-available
 (xpm xbm pbm)
 :request
 (:backend url-retrieve)
 :ein
 (:version "0.2.1alpha2"
           :source-dir "d:/HOME/.emacs.d/elpa/ein-20130611.1651/")
 :lib
 ((:name "websocket"
         :path "~/.emacs.d/elpa/websocket-20130508.2229/websocket.elc"
         :featurep t
         :version-var websocket-version
         :version "1.0")
  (:name "request"
         :path "~/.emacs.d/elpa/request-20130526.1915/request.elc"
         :featurep t
         :version-var request-version
         :version "0.2.0")
  (:name "auto-complete"
         :path "~/.emacs.d/elpa/auto-complete-20130503.2013/auto-complete.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "auto-complete"
         :path "~/.emacs.d/elpa/auto-complete-20130503.2013/auto-complete.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "popup"
         :path "~/.emacs.d/elpa/popup-20130324.1305/popup.elc"
         :featurep t
         :version-var popup-version
         :version "0.5.0")
  (:name "fuzzy"
         :path "~/.emacs.d/elpa/fuzzy-20120323.1044/fuzzy.elc"
         :featurep nil
         :version-var nil
         :version nil)
  (:name "python"
         :path "c:/emacs-24.3/lisp/progmodes/python.elc"
         :featurep t
         :version-var nil
         :version nil)))
tkf commented 11 years ago

@EvanMisshula Thanks for the info. @fzhang00 Thanks for the report.

This is a tough one. I can only guess.

fzhang00 commented 11 years ago
EvanMisshula commented 11 years ago

Fan, How are you starting ipython? (eg, $ipython notebook --pylab=inline)

Thanks, Evan

On Fri, Jul 5, 2013 at 12:42 PM, Fan Zhang notifications@github.com wrote:

Here is the bug report. Check list

  • I read "Avoid standard Emacs traps" section in https://github.com/tkf/emacs-ipython-notebook/blob/master/CONTRIBUTING.md
  • I checked that IPython works with the browser interface.
  • I checked that the problem was not due to badly compiled files. Removing *.elc files from source directory of EIN and its dependencies did not solve the problem.
  • I checked that the libraries are loaded from intended place. (You can check the location in the "System info" section below)

Description of the problem you have

When I open a notebook with inline plots, I got the following messages and the notebook would not open in emacs:

Contacting host: 127.0.0.1:8888 [2 times] ein: [info] Kernel started: 15675e06-3ac6-455e-9417-183fb739e352 ein: [info] Starting WS: "ws:// 127.0.0.1:8888/kernels/15675e06-3ac6-455e-9417-183fb739e352" ein: [info] Unknown event: status_busy.Kernel [2 times] ein: [info] Unknown event: status_idle.Kernel ein: [info] Unknown event: execution_count.Kernel ein: [info] Unknown event: status_idle.Kernel

On the ipython notebook server side, it says

ERROR:root:First ws message didn't have the form 'identity:[cookie]' - '' 2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Notebook without images would open, but server side displays the same error message. Running zeroein.el according to the quick try instruction result in the same error

My installed packages are

python 2.7.5 ipython 1.0-dev pyzmq==13.1.0 tornado==3.1 Steps to reproduce the problem

On Windows 7 Pro x64

  1. Install winPython 2.7.5 for windows 64 bit, and register it to Windows
  2. Install ipython 1.0 dev from github $> git clone --recursive git://github.com/ipython/ipython.git $> cd ipython $> python setup.py install
  3. Start ipython notebook by ipython notebook
  4. In Emacs, M-x ein:notebooklist-open Then click the [open] link in the notebook list

ERROR:root:First ws message didn't have the form 'identity:[cookie]' - '' 2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Expected output

For notebook with saved inline plots, it would not open in emacs. Minibuffer shows Contacting host: 127.0.0.1:8888 [2 times] ein: [info] Kernel started: 15675e06-3ac6-455e-9417-183fb739e352 ein: [info] Starting WS: "ws:// 127.0.0.1:8888/kernels/15675e06-3ac6-455e-9417-183fb739e352" ein: [info] Unknown event: status_busy.Kernel [2 times] ein: [info] Unknown event: status_idle.Kernel ein: [info] Unknown event: execution_count.Kernel ein: [info] Unknown event: status_idle.Kernel In ipython notebook server, it shows

ERROR:root:First ws message didn't have the form 'identity:[cookie]' - '' 2013-07-05 10:20:33.915 [NotebookApp] Connecting to: tcp://127.0.0.1:63841

Your EIN configuration (in .emacs.d/init.el or somewhere else)

; use ein (require 'request) (require 'ein) Your IPython configuration

  1. What is your IPython version? (run ipython --version): ipython 1.0-dev
  2. How do you start IPython? (e.g., ipython notebook --port 9999): on command prompt: ipython notebook
  3. What is your IPython notebook port number or URL?: 8888

Additional information (if any) System info:

("EIN system info" :emacs-version "GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-17 on MARVIN" :emacs-bzr-version nil :window-system w32 :emacs-variant nil :os (:uname nil :lsb-release nil) :image-types (png gif tiff jpeg xpm xbm pbm) :image-types-available (xpm xbm pbm) :request (:backend url-retrieve) :ein (:version "0.2.1alpha2" :source-dir "d:/HOME/.emacs.d/elpa/ein-20130611.1651/") :lib ((:name "websocket" :path "~/.emacs.d/elpa/websocket-20130508.2229/websocket.elc" :featurep t :version-var websocket-version :version "1.0") (:name "request" :path "~/.emacs.d/elpa/request-20130526.1915/request.elc" :featurep t :version-var request-version :version "0.2.0") (:name "auto-complete" :path "~/.emacs.d/elpa/auto-complete-20130503.2013/auto-complete.elc" :featurep t :version-var nil :version nil) (:name "auto-complete" :path "~/.emacs.d/elpa/auto-complete-20130503.2013/auto-complete.elc" :featurep t :version-var nil :version nil) (:name "popup" :path "~/.emacs.d/elpa/popup-20130324.1305/popup.elc" :featurep t :version-var popup-version :version "0.5.0") (:name "fuzzy" :path "~/.emacs.d/elpa/fuzzy-20120323.1044/fuzzy.elc" :featurep nil :version-var nil :version nil) (:name "python" :path "c:/emacs-24.3/lisp/progmodes/python.elc" :featurep t :version-var nil :version nil)))

— Reply to this email directly or view it on GitHubhttps://github.com/tkf/emacs-ipython-notebook/issues/121#issuecomment-20528165 .

Evan Misshula Doctoral Student (Criminal Justice) CUNY John Jay "Let us reform our schools, and we shall find little reform needed in our prisons." John Ruskin, Unto This Last, essay 2 (1862) English critic, essayist, & reformer (1819 - 1900)

"Instruction does much, but encouragement does everything." Johann Wolfgang Von Goethe www.snrg-nyc.org

fzhang00 commented 11 years ago

Just simply ipython notebook

Update:

I checked my emacs, and there seems to be no curl.el anywhere. So I downloaded it from emacs-curl and placed the curl.el under site-lisp. I also downloaded curl.exe and placed it in my emacs bin folder. This folder is on my system path. Now the ipython notebook server shows

2013-07-05 13:47:31.806 [NotebookApp] Connecting to: tcp://127.0.0.1:50694 ERROR:root:First ws message didn't have the form 'identity:[cookie]' - 'username -127.0.0.1-8889=; username-127.0.0.1-8888=; username='

emacs give me

ein: [info] Opened notebook list at 8888 ein: [info] Opening notebook 64ad8477-fe5f-4926-8fee-8ff2f541bab0... ein: [info] Kernel started: 61420779-35d3-418f-bf1a-ef21d5a99850 ein: [info] Starting WS: "ws://127.0.0.1:8888/kernels/61420779-35d3-418f-bf1a-ef21d5a99850" ein: [info] Unknown event: status_busy.Kernel ein: [info] Unknown event: execution_count.Kernel ein: [info] Unknown event: status_idle.Kernel

EvanMisshula commented 11 years ago

No that should still work.

:-(

On Fri, Jul 5, 2013 at 1:59 PM, Fan Zhang notifications@github.com wrote:

Just simply ipython notebook

Update:

I checked my emacs, and there seems to be no curl.el anywhere. So I downloaded it from emacs-curl and placed the curl.el under site-lisp. I also downloaded curl.exe and placed it in my emacs bin folder. This folder is on my system path. Now the ipython notebook server shows

2013-07-05 13:47:31.806 [NotebookApp] Connecting to: tcp://127.0.0.1:50694 ERROR:root:First ws message didn't have the form 'identity:[cookie]' - 'username -127.0.0.1-8889=; username-127.0.0.1-8888=; username='

emacs give me

ein: [info] Opened notebook list at 8888 ein: [info] Opening notebook 64ad8477-fe5f-4926-8fee-8ff2f541bab0... ein: [info] Kernel started: 61420779-35d3-418f-bf1a-ef21d5a99850 ein: [info] Starting WS: "ws:// 127.0.0.1:8888/kernels/61420779-35d3-418f-bf1a-ef21d5a99850"

ein: [info] Unknown event: status_busy.Kernel ein: [info] Unknown event: execution_count.Kernel ein: [info] Unknown event: status_idle.Kernel

Reply to this email directly or view it on GitHubhttps://github.com/tkf/emacs-ipython-notebook/issues/121#issuecomment-20531527 .

Evan Misshula Doctoral Student (Criminal Justice) CUNY John Jay "Let us reform our schools, and we shall find little reform needed in our prisons." John Ruskin, Unto This Last, essay 2 (1862) English critic, essayist, & reformer (1819 - 1900)

"Instruction does much, but encouragement does everything." Johann Wolfgang Von Goethe www.snrg-nyc.org

fzhang00 commented 11 years ago

An update:

I re-install winpython 64bit, which comes with ipython 0.13.2, and it worked. Notebook can be opened in Emacs, and plots displayed properly.

However, I really love to have ipython 1.0 dev working, which allow for switching plotting backend.

tkf commented 11 years ago

Great. Thanks for checking that. I'll try to infer the bug from the error log you posted. But as I said it is working fine in Linux I don't know if I can find the fix. Give me sometime.

BTW, reqeust.el does not use curl.el. It uses curl command line program directly.

tkf commented 11 years ago

Actually the error log was informative. I think #122 fixed the problem. However, if we pull #122 it will stop working for IPython < 1.0 if you use password protected connection. As IPython 1.0 is not released yet, I am not sure if we want to pull it now. It is simple to add an option to switch 1.0/pre-1.0, though. But I'd like to know if it really fixes the problem.

@fzhang00 Can you check that #122 fixes your problem? You can (1) download ein-kernel.el from #122, (2) replace it with your ein-kernel.el, (3) remove ein-kernel.elc if you have it and (4) restart Emacs.

fzhang00 commented 11 years ago

The fix from #122 is working with the ipython 1.0 dev downloaded today.

tkf commented 11 years ago

Thank you for checking!