satijalab / seurat-data

Dataset distribution for Seurat
GNU General Public License v3.0
129 stars 48 forks source link

Error (and possible solution) for installing SeuratData with R 3.4.4 #12

Closed GiantSpaceRobot closed 5 years ago

GiantSpaceRobot commented 5 years ago

Hi there,

I am using R 3.4.4 (Ubuntu default). I tried to install SeuratData using a few methods: install.packages("SeuratData")

Installing package into ‘/home/name/R/x86_64-pc-linux-gnu-library/3.4’ (as ‘lib’ is unspecified) Warning in install.packages : package ‘seurat-data’ is not available (for R version 3.4.4)

This failed. I downloaded the zip and tried to install from local:

install.packages("/home/name/Applications/SeuratData/seurat-data-master.zip", type="source", repos=NULL)

Installing package into ‘/home/name/R/x86_64-pc-linux-gnu-library/3.4’ (as ‘lib’ is unspecified) Error in rawToChar(block[seq_len(ns)]) : embedded nul in string: 'PK\003\004\n\0\0\0\0\0Yn\xf0N\0\0\0\0\0\0\0\0\0\0\0\0\023\0\t\0seurat-data-master/UT\005\0\001\xaa8.]PK\003\004\n\0\0\0\b\0Yn\xf0N\x8ewq\xa1\030\0\0\0\034\0\0\0 \0\t\0seurat-data-' Warning in install.packages : installation of package ‘/home/name/Applications/SeuratData/seurat-data-master.zip’ had non-zero exit status

This also failed. I created a tar from the unzipped directory and tried using devtools in install:

devtools::install_local("/home/name/Applications/SeuratData/seurat-data.tar.gz")

✔ checking for file ‘/tmp/Rtmp2kFrnh/remotesaa4b171702e/seurat-data-master/DESCRIPTION’ ... ─ preparing ‘SeuratData’: ✔ checking DESCRIPTION meta-information ... ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘SeuratData_0.1.0.tar.gz’

Installing package into ‘/home/name/R/x86_64-pc-linux-gnu-library/3.4’ (as ‘lib’ is unspecified)

  • installing source package ‘SeuratData’ ... R preparing package for lazy loading ** help * installing help indices building package indices ** testing if installed package can be loaded Error: package or namespace load failed for ‘SeuratData’: .onAttach failed in attachNamespace() for 'SeuratData', details: call: available.packages(repos = getOption(x = "SeuratData.repo.use"), error: unused argument (ignore_repo_cache = TRUE) Error: loading failed Execution halted ERROR: loading failed
  • removing ‘/home/name/R/x86_64-pc-linux-gnu-library/3.4/SeuratData’ Error in i.p(...) : (converted from warning) installation of package ‘/tmp/Rtmp2kFrnh/fileaa4b5bd33c6e/SeuratData_0.1.0.tar.gz’ had non-zero exit status In addition: Warning message: In is.na(remote_deps$package) : is.na() applied to non-(list or vector) of type 'NULL'

It failed again and complained about an unused argument. I commented-out this line of code from zzz.R (lines 177-179):

fields = c('Description', 'Title'))#, 
    #ignore_repo_cache = TRUE
  #)

I re-created the tar.gz file and re-ran the devtools install:

devtools::install_local("/home/name/Applications/SeuratData/seurat-data.tar.gz")

✔ checking for file ‘/tmp/Rtmp2kFrnh/remotesaa4b43ef0509/seurat-data-master/DESCRIPTION’ ... ─ preparing ‘SeuratData’: ✔ checking DESCRIPTION meta-information ... ─ checking for LF line-endings in source and make files and shell scripts

─ checking for empty or unneeded directories ─ building ‘SeuratData_0.1.0.tar.gz’ Installing package into ‘/home/name/R/x86_64-pc-linux-gnu-library/3.4’ (as ‘lib’ is unspecified)

  • installing source package ‘SeuratData’ ... R preparing package for lazy loading ** help * installing help indices building package indices ** testing if installed package can be loaded
  • DONE (SeuratData) Warning message: In is.na(remote_deps$package) : is.na() applied to non-(list or vector) of type 'NULL'

This worked, I can now load the library without any trouble.

mojaveazure commented 5 years ago

Did you try the installation instructions provided on the README? I would strongly recommend not modifying parts of zzz.R as those are necessary for interacting with the data repository.

GiantSpaceRobot commented 5 years ago

I did but unfortunately they did not work for me.

mojaveazure commented 5 years ago

Can you try installing the development version of SeuratData?

devtools::install_github("satijalab/seurat-data", ref = 'develop')
GiantSpaceRobot commented 5 years ago

No problem.

devtools::install_github("satijalab/seurat-data", ref = 'develop')

Downloading GitHub repo satijalab/seurat-data@develop Installing 1 packages: rappdirs Installing package into ‘/home/name/R/x86_64-pc-linux-gnu-library/3.4’ (as ‘lib’ is unspecified) trying URL 'https://cloud.r-project.org/src/contrib/rappdirs_0.3.1.tar.gz' Content type 'application/x-gzip' length 12838 bytes (12 KB)

downloaded 12 KB

  • installing source package ‘rappdirs’ ... package ‘rappdirs’ successfully unpacked and MD5 sums checked libs gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c win-path.c -o win-path.o g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o rappdirs.so win-path.o -L/usr/lib/R/lib -lR installing to /home/name/R/x86_64-pc-linux-gnu-library/3.4/rappdirs/libs R preparing package for lazy loading ** help * installing help indices building package indices ** testing if installed package can be loaded
  • DONE (rappdirs)

The downloaded source packages are in ‘/tmp/Rtmp2kFrnh/downloaded_packages’ ✔ checking for file ‘/tmp/Rtmp2kFrnh/remotesaa4b6a818537/satijalab-seurat-data-e652918/DESCRIPTION’ ... ─ preparing ‘SeuratData’: ✔ checking DESCRIPTION meta-information ... ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘SeuratData_0.1.0.9001.tar.gz’

Installing package into ‘/home/name/R/x86_64-pc-linux-gnu-library/3.4’ (as ‘lib’ is unspecified)

  • installing source package ‘SeuratData’ ... R exec inst preparing package for lazy loading ** help * installing help indices building package indices ** testing if installed package can be loaded Error: package or namespace load failed for ‘SeuratData’: .onAttach failed in attachNamespace() for 'SeuratData', details: call: available.packages(repos = getOption(x = "SeuratData.repo.use"), error: unused argument (ignore_repo_cache = TRUE) Error: loading failed Execution halted ERROR: loading failed
  • removing ‘/home/name/R/x86_64-pc-linux-gnu-library/3.4/SeuratData’
  • restoring previous ‘/home/name/R/x86_64-pc-linux-gnu-library/3.4/SeuratData’ Error in i.p(...) : (converted from warning) installation of package ‘/tmp/Rtmp2kFrnh/fileaa4b7c6b14d6/SeuratData_0.1.0.9001.tar.gz’ had non-zero exit status In addition: Warning message: In is.na(remote_deps$package) : is.na() applied to non-(list or vector) of type 'NULL'

It failed again on the same error unfortunately.

mojaveazure commented 5 years ago

Okay, now I see it. Apparently, R 3.4.X and lower did not cache package repository indexes, whereas R 3.5.X and higher do. As such, available.packages for R 3.4.X does not have the ignore_repo_cache parameter. It looks like you'll need to upgrade your R version to R 3.5.X or 3.6.X to use SeuratData. I will update the DESCRIPTION to make note of this requirement

1abir commented 3 years ago

Solution For Windows

Run the following commands in R terminal

install.packages("devtools", type = "win.binary") devtools::install_github('satijalab/seurat-data')

Hope this solved your issue.

Jonathanyu2014 commented 2 years ago

Solution For Windows

Run the following commands in R terminal

install.packages("devtools", type = "win.binary") devtools::install_github('satijalab/seurat-data')

Hope this solved your issue.

This worked for me (win10 with Rstuido and R v4.2.0α)