Operating system: Windows 10 Description of the problem : I can download the package alright. But when it comes to "library(synapser)", the error occurs. Expected behavior : library(synapser) Actual behavior: library(synapser) Error: package or namespace load failed for ?synapser?: .onLoad failed in loadNamespace() for 'synapser', details: call: PythonEmbedInR::pyExec("syn=synapseclient.Synapse(skip_checks=True)") error: Traceback (most recent call last): File "", line 1, in File "C:/Program Files/R/R-3.6.1/library/synapser\Lib\site-packages\synapseclient-1.9.3-py3.5.egg\synapseclient\client.py", line 215, in init self.cache = cache.Cache(cache_root_dir) File "C:/Program Files/R/R-3.6.1/library/synapser\Lib\site-packages\synapseclient-1.9.3-py3.5.egg\synapseclient\cache.py", line 89, in init self.cache_root_dir = cache_root_dir File "C:/Program Files/R/R-3.6.1/library/synapser\Lib\site-packages\synapseclient-1.9.3-py3.5.egg\synapseclient\cache.py", line 83, in setattr os.makedirs(value) File "os.py", line 231, in makedirs File "os.py", line 241, in makedirs OSError: [WinError 123] The filename, directory name, or vol In addition: Warning messages: 1: In readChar(f, 2) : can only read in bytes in a non-UTF-8 MBCS locale 2: In readChar(f, 2) : can only read in bytes in a non-UTF-8 MBCS locale Output of sessionInfo(): R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17763) Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_3.6.1 R6_2.4.0 tools_3.6.1 codetools_0.2-16 [5] pack_0.1-1 PythonEmbedInR_0.3.37

Created by TuTu
Appreciate your patience! We will work on this issue towards allowing all folder names that the operating system supports.
@kdaily @Admin-Hoff I have found that my chinese directory name result in this problem. I tried to library the package in another account with english directory name it succeeded. Thank you for your long-time guidance! Hope that it won't occur other errors.... And i have a modest proposal : i wish chinese directory could be discerned. I think it could help many people like me. Thanks again!
@TuTu thank you for running the script we sent. Could you now please run the following and let us know the outcome? ``` library(PythonEmbedInR) srcDir <- system.file(package = "synapser") PythonEmbedInR::pyImport("sys") PythonEmbedInR::pyExec(sprintf("sys.path.insert(0, '%s')", file.path(srcDir, "python"))) PythonEmbedInR::pyImport("installPythonClient") PythonEmbedInR::pyExec( sprintf("installPythonClient.addLocalSitePackageToPythonPath('%s')", srcDir) ) pyImport("synapseclient") pyImport("os") pyExec("value=synapseclient.cache.CACHE_ROOT_DIR") pyGet("value") pyGet("os.path.expanduser(value)") pyExec("value = os.path.expandvars(os.path.expanduser(value))") pyGet("value") pyGet("os.path.exists(value)") pyGet("os.makedirs(value)") ``` Thank you in advance!
@kdaily > library(PythonEmbedInR) > srcDir <- system.file(package = "synapser") > PythonEmbedInR::pyImport("sys") > PythonEmbedInR::pyExec(sprintf("sys.path.insert(0, '%s')", file.path(srcDir, "python"))) > PythonEmbedInR::pyImport("installPythonClient") > PythonEmbedInR::pyExec( + sprintf("installPythonClient.addLocalSitePackageToPythonPath('%s')", srcDir) + ) > pyImport("synapseclient") > pyImport("os") > > pyGet("synapseclient.cache.CACHE_ROOT_DIR") [1] "~\\.synapseCache" > pyGet("synapseclient.client.CONFIG_FILE") [1] "C:/Users/??/Documents\\.synapseConfig" > pyGet("os.path.isfile(synapseclient.client.CONFIG_FILE)") [1] FALSE It seems there is something wrong in the third line? You are a very nice and patient person,I'm so glad to seek help from you ,Thanks!
@TuTu , I received some assistance from our engineering team. To help us debug, could you run the following, and reply with the output you get? The last three lines will print something to the R console. Thanks! ```r library(PythonEmbedInR) srcDir <- system.file(package = "synapser") PythonEmbedInR::pyImport("sys") PythonEmbedInR::pyExec(sprintf("sys.path.insert(0, '%s')", file.path(srcDir, "python"))) PythonEmbedInR::pyImport("installPythonClient") PythonEmbedInR::pyExec( sprintf("installPythonClient.addLocalSitePackageToPythonPath('%s')", srcDir) ) pyImport("synapseclient") pyImport("os") pyGet("synapseclient.cache.CACHE_ROOT_DIR") pyGet("synapseclient.client.CONFIG_FILE") pyGet("os.path.isfile(synapseclient.client.CONFIG_FILE)") ```
I tested this on a coworker's Windows 10 laptop and I could install and load the 'synapser' package successfully. I'm going to escalate this in our engineering team to get someone to debug it further.
@kdaily could you library(synapser) and operate normally on a windows machine? I could also install the package but every time i library(synapser) it errors.
@kdaily According to your guidance, I had updated my windows 10 for version 1909 and OS build 18363.476 and i succeed in creating a directory named ".synapseCache". But the problem still exist... I reinstalled the package again and it didn't work.
@TuTu , I tested on a co-worker's Windows machine and I was able to install the 'synapser' package, as well as create a directory with a 'dot' in it. Could you kindly use these instructions to find out which Windows 10 build version you have? Look for the field called "OS Build". https://www.howtogeek.com/236195/how-to-find-out-which-build-and-version-of-windows-10-you-have/ I'm asking because I noted that a build from April 2019 added the ability to create 'hidden' directories - those are directories that begin with a dot (period), just like this case! The document I read that noted this is here (just for information, nothing that you need to do with it!) https://winaero.com/blog/you-can-create-rename-files-start-with-dot-windows-10/ Thanks again.
Hi @TuTu , Thanks for trying. Sorry to confuse you with that link, it was only to indicate that we are tracking the issue to resolve it, and for anyone else who might come to this post. I'm going to test out some things on a Windows machine to try and debug and will get back to you here. I appreciate your patience!
@kdaily Thanks for your suggestion! But i found i can't make it out. I couldn't creat a directory named with the period ( . ) at the beginning. System always warned errors... And i couldn't open : https://docs.python.org/3.5/library/os.path.html. It showed 404 NOT FOUND. I am a newcomer to R and github, the links you gave may actually help but i found it hard for me to understand the codes. I had tried to search other ways to creat the directory but it all failed... Thank you for your patient reply again!
Hi @TuTu , Yes 'PythonEmbedInR' is required to use the 'synapser' package. I think this is a bug specific to your Windows environment. I have filed it here: https://sagebionetworks.jira.com/browse/SYNR-1438 Could you try the following: create a directory named `.synapseCache` in your current user's home directory? Please note the period (`.`) at the beginning, I'm not exactly sure of the path on a Windows machine to the home directory, but I think it's something like `C:\Users\USERNAME`. If you cannot find out I will follow up with one of our other engineers. After you create this directory, try to load the package in R as usual: ``` library(synapser) ```
Sara,thanks for your attention! I detached other packages expect some basic ones but it still didn't work... The R package "synapser" was installed using "install.packages("synapser", repos=c("http://ran.synapse.org", "http://cran.fhcrc.org"))", it also installed a package called ?PythonEmbedInR?. It seems "PythonEmbedInR" were supporting package for synapser, when i removed it synapser error occured. -Tu Tu
Hi there, `synapser` often conflicts with other packages that are installed if they have some python libraries underneath. What happens if you load `synapser` without the other libraries loaded? -sara

Unable to load library(synapser) page is loading…