pony-ssh
pony-ssh copied to clipboard
Remote host does not have Python installed
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?
What happens on your linux box when you ssh to it as frederic and execute:
$ /usr/bin/python3.9 --version
$ python --version
?
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.
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 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?
@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 whilepython --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.
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.