2016-03-20 13 views
-1

Ich mag Emacs und möchte eine Python-Shell von Tramp ausführen. Mein emacs24.5 installiert in Cygwin64 in einem win7 und Fern python27 von anaconda2 auf einem anderen PC mit CnetOS installiert ist 7. Meine Emacs-Konfigurationsdatei über Python mag:Verwenden von Tramp in Python-Shell von Cygwin emacs24.5

(provide 'setup-python) 
(require 'python-mode) 

(setq python-shell-virtualenv-path "/ssh:[email protected]:/home/username/anaconda2/") 
(add-hook 'python-mode-hook 'anaconda-mode) 

Zuerst soll ich C-x C-f /ssh:[email protected]: zur Eingabe von Passwort laufen und öffnen eine Remote-Datei durch Tramp. Führen Sie dann M-x python aus, um eine Python-Shell remote zu öffnen. Allerdings gibt es einige, was falsch fern Python responsed wie:

Python 2.7.11 |Anaconda 2.4.1 (64-bit)| (default, Dec 6 2015, 18:08:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
Anaconda is brought to you by Continuum Analytics. 
Please check out: http://continuum.io/thanks and https://anaconda.org 
>>> Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
IOError: [Errno 2] No such file or directory: '/usr/tmp/py-shell-completion-setup-code.py' 
>>> Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
IOError: [Errno 2] No such file or directory: '/usr/tmp/py-ffap-setup-code.py' 
>>> Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
IOError: [Errno 2] No such file or directory: '/usr/tmp/py-eldoc-setup-code.py' 
>>> 

Bitte sagen Sie mir, warum und wie es zu lösen

By the way, wenn ich M-x ipython zum Öffnen eines ipython Shell ausgeführt, gibt es ein Fehler wie:

Python 2.7.11 |Anaconda 2.4.1 (64-bit)| (default, Dec 6 2015, 18:08:32) 
Type "copyright", "credits" or "license" for more information. 

IPython 4.0.1 -- An enhanced Interactive Python. 
?   -> Introduction and overview of IPython's features. 
%quickref -> Quick reference. 
help  -> Python's own help system. 
object? -> Details about 'object', use 'object??' for extra details. 
: cannot connect to X server 

ich weiß nicht, warum es sagt cannot connect to X server.

Antwort

0

Das Setup von python.el und python-mode.el ist nicht identisch. AFAIK M-x (i) python RET funktioniert nur mit python-mode.el - welches von melpa verfügbar ist. Es sollte sofort funktionieren, das ist zumindest das Ziel.

Wenn nicht, prüfen Sie bitte den Bug auf diese Weise berichten: von Verzeichnis, in dem Python-mode.el befindet: Emacs -Q python-mode.el RET bewerten ... Bitte melden Sie jede Frage bei https://bugs.launchpad.net/python-mode oder https://gitlab.com/groups/python-mode-devs/issues

WRT python.el siehe Hinweise zur Anpassung am Kopf der Datei.

+0

Es bedeutet, dass dies ein Fehler in python-mode.el ist? – nannanmath

+0

@nannanmath Noch nicht. Dein Setup sieht seltsam aus. Die Suche nach Fehlern würde weitere Informationen erfordern, die für eine einfache Q/A-Site wie diese nicht geeignet sind. –

0

Ich finde, dass der Wert der Variablen py-temp-directory lehrt Python-Modus, wo die temporären Dateien erstellt und durchsucht werden. Der Standardwert ist /usr/tmp, daher werden die temporären Dateien jedes Mal auf dem lokalen Host erstellt. Ich setze py-temp-directory als Remote-Pfad von setq als /ssh:[email protected]:/usr/tmp und führen M-x python. Ich sehe, dass einige temporäre Dateien auf remote/usr/tmp erstellt werden. Dann, aufgrund des Suchpfads ist auch py-temp-directory, ich setze es als /usr/tmp. Run M-x python, alles ist in Ordnung.

Ich versuche auch py-custom-temp-directory als Remote-Pfad zu setzen, aber es funktioniert nicht. Ich möchte wissen, wie man py-custom-temp-directory verwendet?

Verwandte Themen