millejoh / emacs-ipython-notebook

Jupyter notebook client in Emacs
http://millejoh.github.io/emacs-ipython-notebook/
GNU General Public License v3.0
1.47k stars 122 forks source link

warn ein:cell-append-mime-type: no viewer method found in mailcap #671

Closed yefeiyu closed 4 years ago

yefeiyu commented 4 years ago

Problem description

The ein-2020***.el can't show figure such as plt.show() ,or display(HTML(tabulate.tabulate(df, tablefmt='html')))' s table.

Steps to reproduce the problem

System info:

("EIN system info"
 :emacs-version
 "GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1894.30 Version 10.15.3 (Build 19D76))
 of 2020-02-22"
 :emacs-bzr-version nil
 :window-system ns
 :emacs-variant nil
 :os
 (:uname
  "Darwin CharlesdeMacBook-Pro 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
"
  :lsb-release nil)
 :notebook nil
 :ipython nil
 :image-types
 (png gif tiff jpeg xpm xbm pbm)
 :image-types-available
 (png gif tiff jpeg xpm xbm pbm)
 :request
 (:backend curl)
 :ein
 (:version "20200219.1501"
       :source-dir "/Users/charlesthomas/.emacs.d/elpa/ein-20200219.1501/")
 :lib
 ((:name "websocket"
     :path "~/.emacs.d/elpa/websocket-20200102.637/websocket.elc"
     :featurep t
     :version-var websocket-version
     :version "1.12")
  (:name "anaphora"
     :path "~/.emacs.d/elpa/anaphora-20180618.2200/anaphora.elc"
     :featurep t
     :version-var nil
     :version nil)
  (:name "request"
     :path "~/.emacs.d/elpa/request-20200219.2257/request.elc"
     :featurep t
     :version-var request-version
     :version "0.3.0")
  (:name "deferred"
     :path "~/.emacs.d/elpa/deferred-20170901.1330/deferred.elc"
     :featurep t
     :version-var deferred:version
     :version "0.5.0")
  (:name "polymode"
     :path "~/.emacs.d/elpa/polymode-20191208.1239/polymode.elc"
     :featurep t
     :version-var nil
     :version nil)
  (:name "dash"
     :path "~/.emacs.d/elpa/dash-20200119.2310/dash.elc"
     :featurep t
     :version-var nil
     :version nil)))
dickmao commented 4 years ago

Fortunately, you are using emacs 27.0.50, which makes user-level mailcap config easier.

Add the line

image/*; eog %s

to $HOME/.mailcap. Or if you don't have eog, try display or whatever OSX's no-frills image viewer is. For emacs25 and emacs26, refer to FAQ.

yefeiyu commented 4 years ago

Fortunately, you are using emacs 27.0.50, which makes user-level mailcap config easier.

Add the line

image/*; eog %s

to $HOME/.mailcap. Or if you don't have eog, try display or whatever OSX's no-frills image viewer is. For emacs25 and emacs26, refer to FAQ.

thank you for your reply. But I didn't use Linux, I am use Mac, so I can't find eog . and, why there had a file with name .mailcap? I had deleted entire folder of .emacs.d and .emacs, rebuild emacs with only one elpa of ein, but it is still remain the error of ........mailcap.

I found the file filled with win-files exe lines....

image/*; eog %s
x-content/win32-software; "/Users/charlesthomas/Library/Application Support/CrossOver/desktopdata/CrossOver-0/cxassoc/Scripts/CrossOver-0:application_x-crossover-exe::install" '%s'; \
    description="CrossOver (Install)"; \
    test=test -n "$DISPLAY"
application/x-crossover-exe; "/Users/charlesthomas/Library/Application Support/CrossOver/desktopdata/CrossOver-0/cxassoc/Scripts/CrossOver-0:application_x-crossover-exe::install" '%s'; \
    description="CrossOver (Install)"; \
    test=test -n "$DISPLAY"
application/x-crossover-lnk; "/Users/charlesthomas/Library/Application Support/CrossOver/desktopdata/CrossOver-0/cxassoc/Scripts/CrossOver-0:application_x-crossover-lnk::run" '%s'; \
    description="CrossOver (Run)"; \
    test=test -n "$DISPLAY"
application/x-ms-shortcut; "/Users/charlesthomas/Library/Application Support/CrossOver/desktopdata/CrossOver-0/cxassoc/Scripts/CrossOver-0:application_x-crossover-lnk::run" '%s'; \
    description="CrossOver (Run)"; \
    test=test -n "$DISPLAY"
application/x-win-lnk; "/Users/charlesthomas/Library/Application Support/CrossOver/desktopdata/CrossOver-0/cxassoc/Scripts/CrossOver-0:application_x-crossover-lnk::run" '%s'; \
    description="CrossOver (Run)"; \
    test=test -n "$DISPLAY"
application/x-crossover-msi; "/Users/charlesthomas/Library/Application Support/CrossOver/desktopdata/CrossOver-0/cxassoc/Scripts/CrossOver-0:application_x-crossover-msi::install" '%s'; \
    description="CrossOver (Install)"; \
    test=test -n "$DISPLAY"
yefeiyu commented 4 years ago

I resolved this problem by turn the customize-group-ein-image on. Thanks dickmao for your help very much ! I love EIN! It's so great!

dickmao commented 4 years ago

Your mailcap looks reasonable. Maybe replace eog %s with /usr/bin/qlmanage -p %s. I used to think having images inlined was nice, but I now much prefer displaying them externally. Images, especially big ones, just get in the way of coding/thinking.

ghost commented 3 years ago

Hi, I am on Windows 10 and getting this error. Was not able to find the customize-group-ein-image command, where should I look for it? Is there any other fix? Thank you!

kindinn commented 3 years ago

If you go to customize-group -> ein, search for 'image', it will be listed as Ein:Output Area Inlined Images. Toggling this on worked for me

mikenlee commented 1 year ago

@kindinn answer worked for me. For newbies like me: enter customize-group after you press M-x