Sage-Bionetworks / synapser

An R package providing programmatic access to Synapse
Apache License 2.0
32 stars 21 forks source link

No module named 'pysftp' #226

Closed tiagochst closed 5 years ago

tiagochst commented 5 years ago

Operating system

Max OSX

Description of the problem

Cannot upload data using the package. It says: No module named 'pysftp', but pysftp is installed for Python 3.6.4.

fileEntity <- synGet("syn18265702")
file <- File(path ="~/Downloads/merged_metadata.csv", parent = fileEntity)
file <- synStore(file)

Expected behavior

File upload

Actual behavior

Error in value[[3L]](cond) : No module named 'pysftp'

Output of sessionInfo()

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.14

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] synapserutils_0.1.4 synapser_0.5.45

loaded via a namespace (and not attached):
[1] compiler_3.5.1        R6_2.3.0              codetools_0.2-16
[4] pack_0.1-1            PythonEmbedInR_0.3.25
kimyen commented 5 years ago

@tiagochst,

Thank you for reporting the issue and include detailed information! We appreciate it. Our synapser wraps our Python client. However, synapser manages its own Python environment and this Python environment is separated from user's Python environment. In the Python environment that is managed by synapser, we do not include pysftp package.

You probably running into this issue because you were downloading/uploading files that are hosted from an SFTP server and linked to Synapse. synapser client is not supporting this usage.

Although, perhaps we should throw a more reasonable error in this case. I would advice to use out web client or our Python client to download/upload these files.

kimyen commented 5 years ago

The folder that you are uploading the file to has storage setting set to sftp:

screen shot 2019-02-13 at 1 14 13 pm
tiagochst commented 5 years ago

Thanks! I used the Python client and I was able to upload the data.