QizhiSu / mspcompiler

Compile Mass Spectral Libraries from Various Sources
Other
15 stars 1 forks source link

Very eager to use, but issue installing :-/ #1

Closed tlgroff closed 2 years ago

tlgroff commented 2 years ago

Hi QizhiSu, I have had issues installing, it seems to mainly be regarding ChemineR and ChemineOB. I am new to R however, so this may not be the case.. Are there packages that must be previously installed, or libraries that need to be loaded for the installation? I am really excited to use your program, as it will make my life much easier. Thanks!!

tlgroff commented 2 years ago

I get the following error:

The downloaded binary packages are in
    /var/folders/j7/338rf36x105g2zk_2q6wmw600000gn/T//RtmpC2cfp6/downloaded_packages
✓  checking for file ‘/private/var/folders/j7/338rf36x105g2zk_2q6wmw600000gn/T/RtmpC2cfp6/remotes10ee3d7b7c08/QizhiSu-mspcompiler-703f515/DESCRIPTION’ (343ms)
─  preparing ‘mspcompiler’:
✓  checking DESCRIPTION meta-information ...
─  installing the package to build vignettes (379ms)
         -----------------------------------
─  installing *source* package ‘mspcompiler’ ...
   ** using staged installation
   ** R
   ** data
   *** moving datasets to lazyload DB
   ** inst
   ** byte-compile and prepare package for lazy loading
   Error: .onLoad failed in loadNamespace() for 'ChemmineOB', details:
     call: dyn.load(file, DLLpath = DLLpath, ...)
     error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/ChemmineOB/libs/ChemmineOB.so':
     dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/ChemmineOB/libs/ChemmineOB.so, 10): Library not loaded: /usr/local/opt/open-babel/lib/libopenbabel.7.dylib
     Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/ChemmineOB/libs/ChemmineOB.so
     Reason: image not found
   Execution halted
   ERROR: lazy loading failed for package ‘mspcompiler’
─  removing ‘/private/var/folders/j7/338rf36x105g2zk_2q6wmw600000gn/T/RtmpN7E44i/Rinst10fbe64f4d67f/mspcompiler’
         -----------------------------------
   ERROR: package installation failed
Error: Failed to install 'mspcompiler' from GitHub:
  System command 'R' failed, exit status: 1, stdout + stderr (last 10 lines):
E>   call: dyn.load(file, DLLpath = DLLpath, ...)
E>   error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/ChemmineOB/libs/ChemmineOB.so':
E>   dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/ChemmineOB/libs/ChemmineOB.so, 10): Library not loaded: /usr/local/opt/open-babel/lib/libopenbabel.7.dylib
E>   Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/ChemmineOB/libs/ChemmineOB.so
E>   Reason: image not found
E> Execution halted
E> ERROR: lazy loading failed for package ‘mspcompiler’
E> * removing ‘/private/var/folders/j7/338rf36x105g2zk_2q6wmw600000gn/T/RtmpN7E44i/Rinst10fbe64f4d67f/mspcompiler’
E>       -----------------------------------
E> ERROR: package installation failed
QizhiSu commented 2 years ago

Hi, Did you try to install ChemmineR and ChemmineOB first following the code in the readme? image

tlgroff commented 2 years ago

Hi, Did you try to install ChemmineR and ChemmineOB first following the code in the readme? image

Yes, I have. Once I do enter the code above, do I then re-try the installation? This is what I have been doing. When I re-try installing, I still have issues with ChemmineR and ChemmineOB - I am prompted to update, and it seems no matter which update option I try there is still problems with the installation. Thanks for your response!

See below for more details (I have labeled my entries with ###, all other lines are output):

> if (!requireNamespace("BiocManager", quietly = TRUE)) ###
+   install.packages("BiocManager") ###
> 
> BiocManager::install("ChemmineR")###
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories'
for details

replacement repositories:
    CRAN: https://cran.rstudio.com/

Bioconductor version 3.12 (BiocManager 1.30.16), R 4.0.3 (2020-10-10)
Warning message:
package(s) not installed when version(s) same as current; use `force = TRUE` to
  re-install: 'ChemmineR' 
> 
> if (!requireNamespace("BiocManager", quietly = TRUE)) ###
+   install.packages("BiocManager") ###
> 
> BiocManager::install("ChemmineOB") ###
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories'
for details

replacement repositories:
    CRAN: https://cran.rstudio.com/

Bioconductor version 3.12 (BiocManager 1.30.16), R 4.0.3 (2020-10-10)
Warning message:
package(s) not installed when version(s) same as current; use `force = TRUE` to
  re-install: 'ChemmineOB' 
> install.packages("devtools") ###
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/devtools_2.4.2.tgz'
Content type 'application/x-gzip' length 393203 bytes (383 KB)
==================================================
downloaded 383 KB

The downloaded binary packages are in
    /var/folders/j7/338rf36x105g2zk_2q6wmw600000gn/T//Rtmp4BxHOB/downloaded_packages
> devtools::install_github("QizhiSu/mspcompiler", build_vignettes = TRUE) ###
Downloading GitHub repo QizhiSu/mspcompiler@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                                         
2: CRAN packages only                          
3: None                                        
4: ChemmineR  (3.42.2 -> 13ab93a3f...) [GitHub]
5: ChemmineOB (1.28.4 -> d4314fc44...) [GitHub]

Enter one or more numbers, or an empty line to skip updates: 1 ###
ChemmineR  (3.42.2 -> 13ab93a3f...) [GitHub]
ChemmineOB (1.28.4 -> d4314fc44...) [GitHub]
Downloading GitHub repo girke-lab/ChemmineR@HEAD
Error: Failed to install 'mspcompiler' from GitHub:
  Failed to install 'ChemmineR' from GitHub:
  Could not find tools necessary to compile a package
Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.
QizhiSu commented 2 years ago

I think the problem was ChemminR and ChemmineOB. Maybe you can try to reinstall them using the force argument.

if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")

BiocManager::install("ChemmineR", force = TRUE)

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("ChemmineOB", force = TRUE)

Thanks for your attention.

Best Qizhi Su

tlgroff commented 2 years ago

I am able to reinstall them using the force argument as shown in the code above. I then use the code:

install.packages("devtools")
devtools::install_github("QizhiSu/mspcompiler", build_vignettes = TRUE)

This immediately prompts me to update as shown in the image below. I have also tried entering in all of the numbers that it suggests.

Screen Shot 2021-11-17 at 1 58 12 PM

Besides entering in numbers to update, I can also restart R to update as shown in the pic below.

Screen Shot 2021-11-17 at 1 56 46 PM

How should I proceed from the point shown in the image below?

Screen Shot 2021-11-17 at 2 05 43 PM

I am able to successfully install ChemmineR and ChemmineOB using the code from your previously reply. It says they are successfully installed, but when I then try to install mspcompiler, it seems no matter which option I choose for updating that building the vignette fails. Do I need to load a specific library before trying to install mspcompiler?

Failure message:

Screen Shot 2021-11-17 at 2 05 13 PM
QizhiSu commented 2 years ago

Hi, No specific library is required before installation. It seems that you still have problem with ChemmineR and ChemmineOB. I reconfirmed that it can be successfully installed on my side and my friend's computer. What operating system are you using?

Maybe you can take a look in the following links: https://support.bioconductor.org/p/119886/ https://github.com/girke-lab/ChemmineOB/issues/11

Hope it will be helpful.

Best regards

ethanbass commented 2 years ago

I don't know if you already solved this issue, but you likely have openbabel installed in a different directory. Try opening your terminal and typing where obabel, then you can trace down the library it is looking for and symlink it into the directory where R is expecting to find it. For me, I installed openbabel with miniconda, so I found it in my miniconda packages. Then you can use something like the following line to create the symlink: sudo ln -s ~/opt/miniconda3/pkgs/openbabel-3.1.1-py39hb4f85b1_3 /usr/local/opt/open-babel

tlgroff commented 2 years ago

Hi, I have solved the problem! Thank you for your help in doing so.

QizhiSu commented 2 years ago

@tlgroff Hi could you please tell me what was the problem?

g0079 commented 2 years ago

I met the same issue but on Windows 10. I think it might be caused by Patroon package which installed open babel automatically on my PC. I uninstalled open babel, then installed it again, and the problem solved.