How to use emacs to open a remote python shell with python-mode and tramp?

Bug #1560340 reported by zhangnan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
New
Medium
Andreas Roehler

Bug Description

My emacs24.5 installed in Cygwin64 in a win7 and remote python27 is installed by anaconda2 on another PC with CnetOS 7. My emacs config file about python likes:

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

    (setq python-shell-virtualenv-path "/ssh:<email address hidden>:/home/username/anaconda2/")
    (add-hook 'python-mode-hook 'anaconda-mode)

First, I should run C-x C-f /ssh:username@ip: to input password and open a remote file through Tramp. Then run M-x python to open a python shell remotely. However, there are some thing wrong responsed by remote python like:

    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'
    >>>

Why there are many IOError? How to solve them?

zhangnan (nannanmath)
information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1560340] [NEW] How to use emacs to open a remote python shell with python-mode and tramp?

On 22.03.2016 07:38, zhangnan wrote:
> Public bug reported:
>
> My emacs24.5 installed in Cygwin64 in a win7 and remote python27 is
> installed by anaconda2 on another PC with CnetOS 7. My emacs config file
> about python likes:
>
> (provide 'setup-python)
> (require 'python-mode)
>
> (setq python-shell-virtualenv-path "/ssh:<email address hidden>:/home/username/anaconda2/")
> (add-hook 'python-mode-hook 'anaconda-mode)
>
> First, I should run C-x C-f /ssh:username@ip: to input password and open
> a remote file through Tramp. Then run M-x python to open a python shell
> remotely. However, there are some thing wrong responsed by remote python
> like:
>
> 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'
> >>>
>
> Why there are many IOError? How to solve them?
>
> ** Affects: python-mode
> Importance: Undecided
> Status: New
>

Thanks reporting. Please follow recipe given at

http://stackoverflow.com/questions/36118022/using-tramp-in-python-shell-from-cygwin-emacs24-5/36131293?noredirect=1#comment59927166_36131293

starting from emacs -Q

Revision history for this message
zhangnan (nannanmath) wrote :

But that is also asked by me.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Did you start from emacs -Q? Are you aware what emacs -Q means?

Changed in python-mode:
status: New → Incomplete
Revision history for this message
Andreas Roehler (a-roehler) wrote :

There might be an issue, if there is no write access at remote machine. Commonly a temporary file is used, which should avoid a certain bug. Will change the default WRT execution at a remote machine, so no write permission is needed.

Changed in python-mode:
status: Incomplete → In Progress
importance: Undecided → Medium
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.2.3
Changed in python-mode:
status: In Progress → New
Changed in python-mode:
milestone: 6.2.3 → 6.2.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.