pony-ssh icon indicating copy to clipboard operation
pony-ssh copied to clipboard

Remote host does not have Python installed

Open FredDgrv opened this issue 3 years ago • 6 comments

On windows 10, I added below conf to my settings.json. I'm using Mobaxterm, which manages pageant & server X.

    "ponyssh.hosts": { 
        "mylinux": {
           "host": "192.168.1.37",
           "username": "frederic",
           "privateKeyFile": "C:/pathtomykey/id_rsa",
           "python": "/usr/bin/python3.9"
        }
      }

And I get that output in vs code:

[2021-04-26 19:24:05] [info] Connection established
[2021-04-26 19:24:05] [info] Preparing worker script
[2021-04-26 19:24:05] [error] Error connecting to mylinux: Remote host does not have Python installed
[2021-04-26 19:24:05] [info] Connecting to mylinux: {
  host: '192.168.1.37',
  username: 'frederic',
  privateKeyFile: 'C:/pathtomykey/id_rsa',
  agent: 'pageant',
  privateKey: '*****'
}

on Linux:

$ whereis python
python: /usr/bin/python3.9-config /usr/bin/python3.9 /usr/lib/python2.7 /usr/lib/python3.9 /etc/python3.8 /etc/python3.9 /usr/local/lib/python3.9 /usr/include/python3.9

What did I do wrong?

FredDgrv avatar Apr 26 '21 19:04 FredDgrv

What happens on your linux box when you ssh to it as frederic and execute:

$ /usr/bin/python3.9 --version
$ python --version

?

GitMensch avatar Sep 03 '21 19:09 GitMensch

I get this /usr/bin/python3.8 --version Python 3.8.10 Still cannot login - the same problem - Error connecting to mylinux: Remote host does not have Python installed.

gurumark avatar Dec 08 '21 20:12 gurumark

Not sure if this was ever resolved but I was having the same issue. You literally need to change your Python3 installation from saying "Python3" to "Python". I did it like this:

$ which python3
> /usr/bin/python3
$ cd /usr/bin/
$ sudo mv python3 python

Vaslo avatar Apr 22 '22 02:04 Vaslo

@Vaslo I highly suggest to never to that, mv it back, then create a symlink instead would be the way to go, but very likely you can just configure this extension as it is documented by adding "python": "python3" or "python": "/usr/bin/python3" to your ssh configuration.

@gurumark I guess python3 --version creates the same output while python --version creates a "command not found" error message, correct? ... and I guess you did not specified the python installation path in your ssh configuration, did you?

GitMensch avatar Apr 24 '22 15:04 GitMensch

@Vaslo I highly suggest to never to that, mv it back, then create a symlink instead would be the way to go, but very likely you can just configure this extension as it is documented by adding "python": "python3" or "python": "/usr/bin/python3" to your ssh configuration.

@gurumark I guess python3 --version creates the same output while python --version creates a "command not found" error message, correct? ... and I guess you did not specified the python installation path in your ssh configuration, did you?

Just wanted to tell you I just had terrible experience with JSON and YAML files when I did this. I've done a lot of work on these types of files and now understand what you meant in your documentation. Setting Python3 as the path per your instructions did the trick. Thanks! Note though that I am not the original poster, just someone who hijacked it with bad advice.

Vaslo avatar Jun 17 '22 00:06 Vaslo

Hi, I have the same problem. In my linux box (rhel 8.5) I have python3.9.6, an alias "python" links to "/usr/bin/python3.9" All my python scripts run perfectly, but when I launch pony-ssh, after giving the password, I got the same error.

ghost avatar Dec 12 '22 15:12 ghost