Skip to content

Example doesn't run: can't import Emacs #4

@notuntoward

Description

@notuntoward

The first example in the package doc has the code

from emacs import Emacs
emacs = Emacs.client()
emacs.getresult('(+ 1 2)')

But when I run it, I get the error

----> [3](vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#ch0000000untitled?line=2) from emacs import Emacs
      [4](vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#ch0000000untitled?line=3) emacs = Emacs.client()
      [5](vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#ch0000000untitled?line=4) emacs.getresult('(+ 1 2)')

ImportError: cannot import name 'Emacs' from 'emacs' (c:\Users\scott\miniconda3\lib\site-packages\emacs\__init__.py)

This is after I've also installed the python-emacs library, which works. For example, I can run this successfully

from emacs import EmacsBatch
emacs = EmacsBatch(args=['-Q']) 
emacs.eval('(+ 1 2)')

Also, I'm not certain if pyorg requires python-emacs, and if so, if pip installing pyorg should install this dependency automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions