0

I'm currently trying to install pandas on my raspberry pi, which I've connected to using an SSH connection, using pip. This is taking a long time, and my laptop has gone to sleep (ending the ssh connection to the Pi). Will the package continue to install, despite the connection dropping out?

If this has not ended the install, can I ssh back into the Pi again and check the status of the install?

Also, would the download of this package (initiated from my laptop) have used the Pi's wifi connection or the internet connection of my laptop?

3
  • 1
    Not Pi specific. I suggest you launch pip using nohup.
    – joan
    May 1 '20 at 21:19
  • You should be using pip3 for python3 modules. Python2 is end-of-life since January 2020.
    – Dougie
    May 2 '20 at 10:40
  • While the question may sound different the solution is the same: raspberrypi.stackexchange.com/q/29641/19949
    – Ghanima
    May 2 '20 at 12:41
2

No it will not. When your SSH session ends, any processes attached to that session will be terminated.

There are a couple of solutions but the one I use most often is the nohup command.

For example, to install using pip this way, the command would look like:

nohup pip3 install boto3 &

The nohup tells Linux to run detached and the trailing & tells it to run in the background. Once you start like this any output will be found in the nohup.out file in the folder you start it in.

1

As already said if you finish the ssh connection then also all running programs you have started in the foreground without additional process management will also terminate. For my opinion the simplest way to avoid this is to use a terminal multiplexer like screen or tmux. I prefer screen.

After login with ssh you can start as first screen. If not available just install it with sudo apt install screen. You will find a usual terminal console but with additional features. With Ctrl+A you can manage screen, e.g. Ctrl+A? you will get help. Within screen just start your application. Then detach from screen with Ctrl+Ad and logout from ssh. You application is still running within screen. Login again with ssh and reattach with screen -r. You will find your application with its output that has run and maybe finished without interruption.

With ssh you are managing the RasPi, not your laptop. So there is also the internet connection used from the RasPi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.