0

I caught that ftplib is available on DSX IBM Datascience Experience

from ftplib import FTP

Bu how does a SFTP connection look inside a python Notebook? So that I can import local data automatically. TIA

1 Answers1

1

The FTP protocol has nothing to do with SFTP. The sftp program is a client for the SSH protocol that behaves like an ftp program for the FTP protocol. In other words, an FTP client library will not help you to connect to an SSH server.

At the moment, there are at least two SFTP client libraries on Python, pysftp and sftp-client. There's also an older question here on SO, from a time where SFTP clients were not as readily available. Maybe one of those libraries serves your needs. If it isn't pre-installed on DSX, you can install it from a Python notebook by running !pip install --user <packagename>.

Community
  • 1
  • 1
Roland Weber
  • 1,865
  • 2
  • 17
  • 27
  • Is there a way to 'ssh' to a data science experience instance to get to the 'raw' linux shell? This seems useful and I can't find any avenue. – Gopala Sep 07 '17 at 19:10
  • @Gopala: No, not with the current Spark as a Service backend running on a shared cluster. Even IBM developers cannot ssh to the nodes of the production cluster. You can run a Python kernel and execute shell commands with the `!` prefix. Either through a notebook in DSX or through Spark Interactive API (a kernel gateway) in Bluemix. https://console.bluemix.net/docs/services/AnalyticsforApacheSpark/index-gentopic3.html#genTopProcId4 – Roland Weber Sep 11 '17 at 05:25