Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote host does not have Python installed #23

Open
FredDgrv opened this issue Apr 26, 2021 · 6 comments
Open

Remote host does not have Python installed #23

FredDgrv opened this issue Apr 26, 2021 · 6 comments

Comments

@FredDgrv
Copy link

FredDgrv commented Apr 26, 2021

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?

@GitMensch
Copy link

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

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

?

@gurumark
Copy link

gurumark commented Dec 8, 2021

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.

@Vaslo
Copy link

Vaslo commented Apr 22, 2022

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

@GitMensch
Copy link

@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
Copy link

Vaslo commented Jun 17, 2022

@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.

@ghost
Copy link

ghost commented Dec 12, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants