1

I am trying to copy a file from my gcp instance to Kaggle (I tried other servers/PCs only to face the same issue).

The issue is that when running the command:

scp -i ./key user@ip_address:/path/to/file /kaggle/working/file

I get:

bash: line 1: scp: command not found

I have figured that the issue has something to do with the environment that my gcp server is using because the following command works as it should, so all the permissions are in place and key is valid:

ssh -i ./key user@ip_address

And when connected I can use the scp command no problem. But what seems suspicious to me is that this command:

ssh -i ./key user@ip_address 'echo $PATH'

outputs:

$PATH:/opt/python/3.9.2/bin:$HOME/.local/bin

And does not clearly include /usr/bin/scp where I confirmed scp is located.

What can be done to fix this? Am I doing something wrong here?

1 Answers1

0

Apparently, you have two computers, let's call them A and B.

If you work on A, you get the message

bash: line 1: scp: command not found

If you ssh into B, you can use scp. Apparently, B has a working set-up for scp and A does not.

Let's first try if this is an environment issue or a missing scp. Try

ls -l /usr/bin/scp

If scp is there, it is an environment issue. If scp is not there, it is missing and you need to install it.

Your PATH looks bizarre.There should not be a $PATH in your PATH. Can you do a simple ls? Probably not.

It is likely, that in some of the bash start-up scripts there is a

PATH='$PATH:/opt/python/3.9.2/bin:$HOME/.local/bin'

instead of

PATH="$PATH:/opt/python/3.9.2/bin:$HOME/.local/bin"

(Notice the difference in quotes)

If you find that line and correct the quotes, it will probably start working.

Ljm Dullaart
  • 2,788