Deploy Shiny application with older version of particular package - deployment

This may be a stupid question, but I'm unable to solve the following issue:
I'm working on a Shiny-app and need an older version of lavaan to obtain the same results as a few weeks ago. I used the following code to install the older version locally: install_version("lavaan",version = "0.5-23.1097"), and I loaded this old version using library(lavaan) into my server.R file. I also added all possible dependencies to my list in the server.R file so that everything works fine locally.
However, when I try to deploy my application, I obtain the following at the end of my task log:
[2018-08-16T17:00:24.569989191+0000] Installing R package: quadprog (1.5-5)
* installing to library �/opt/R/3.4.0/lib/R/library�
* installing *binary* package �quadprog� ...
* DONE (quadprog)
[2018-08-16T17:00:24.749745586+0000] Building R package: lavaan (0.5-23.1097)
/mnt/packages/build /mnt
* installing to library �/opt/R/3.4.0/lib/R/library�
* installing *source* package �lavaan� ...
** package �lavaan� successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/3.4.0/lib/R/library/quadprog/libs/quadprog.so':
libRblas.so: cannot open shared object file: No such file or directory
ERROR: lazy loading failed for package �lavaan�
* removing �/opt/R/3.4.0/lib/R/library/lavaan�
Apparently, it is able to find the old lavaan version and unpack it, but as soon as it performs this lazy loading action, it breaks down.
Does anybody know where I could eliminate this lazy loading or perhaps where to find this quadprog.so or libRblas.so file? I assume that something more essential is going on, but I can't figure it out. Below, you can find my sessionInfo() output.
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Dutch_Belgium.1252 LC_CTYPE=Dutch_Belgium.1252 LC_MONETARY=Dutch_Belgium.1252 LC_NUMERIC=C
[5] LC_TIME=Dutch_Belgium.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lavaan_0.5-23.1097 quadprog_1.5-5 MASS_7.3-47 numDeriv_2016.8-1 htmlwidgets_1.0 jsonlite_1.5 htmltools_0.3.6
[8] yaml_2.2.0 tibble_1.4.2 DT_0.2 ggplot2_2.2.1 rmarkdown_1.8 stringi_1.1.7 foreign_0.8-67
[15] magrittr_1.5 rsconnect_0.8.5 shinyjs_0.9.1 shinythemes_1.1.1 shiny_1.1.0 devtools_1.13.6
loaded via a namespace (and not attached):
[1] Rcpp_0.12.18 git2r_0.18.0 pillar_1.3.0 compiler_3.4.0 later_0.7.3 plyr_1.8.4 bitops_1.0-6 tools_3.4.0
[9] digest_0.6.12 memoise_1.1.0 evaluate_0.10.1 gtable_0.2.0 rlang_0.2.1 rstudioapi_0.6 curl_3.1 pbivnorm_0.6.0
[17] httr_1.2.1 withr_1.0.2 stringr_1.2.0 knitr_1.17 stats4_3.4.0 rprojroot_1.2 grid_3.4.0 R6_2.2.2
[25] RJSONIO_1.3-0 backports_1.1.0 scales_0.4.1 promises_1.0.1 mnormt_1.5-5 mime_0.5 xtable_1.8-2 colorspace_1.3-2
[33] httpuv_1.4.5 miniUI_0.1.1 RCurl_1.95-4.8 lazyeval_0.2.0 munsell_0.4.3 crayon_1.3.4
Many thanks in advance!!
Kind regards

Apparently, my issue had nothing to do with managing package versions.
The solution can be found on this link, thanks to Joshua Spiewak.
The gist is that the package quadprog was improperly compiled, although it was successfully installed. Flushing the package from the cache for R 3.4.0 solved the issue.
Thank you all for helping out!

Try using packrat to manage you package versions. This is how I run shiny apps with different versions of packages and it makes them deployable to connect servers in a way that maintains the correct package.

Related

Tessarect implementation JAVA

I'm trying to implement OCR recognition through Tessarect.
But at the moment I'm stuck with this error.
This is what I've done so far:
Homebrew tessarect
Download the API
Link the Jar with my project (build path > Configure build path > Add external Jar's
But when I compile my code this is the error
Error opening data file D:/Tess4J/tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
Warning: Invalid resolution 0 dpi. Using 70 instead.
I've downloaded the eng trained data and I've tried different stuff but I can't figure out how to solve this.
I'm running eclipse in macOS Catalina.
Thanks!
My situation
Set your datapath correctly.
Your location D:/Tess4J/tessdata/eng.traineddata is wrong

Pharo on RaspberryPi: Module not found at startup

I am on a raspbian stretch system with the spur32 VM for ARM and a Pharo 7 image. At Startup I always get an exception: Error - Module not found.
It seems to have to do with lgitlibrary. I really cannot figure out what this error is about.
Any ideas?
Thanks,
Henrik
I see. If you check #unixModuleName
unixModuleName
| pluginDir |
pluginDir := Smalltalk vm binary parent.
#('libgit2.so' 'libgit2.so.0')
detect: [ :each | (pluginDir / each) exists ]
ifFound: [ :libName | ^ libName ].
self error: 'Module not found.'
Here you have your error message: self error: 'Module not found.'
You probably have libgit2.so or libgit2.so.0 missing (or dependencies). You may suffer with similar problem as me: Getting error when adding OSSubprocess to my Pharo 6.1 on Centos 7.4x.
You should check the dependencies with ldd (check my question for details).
Edit Adding information due to comment:
I have yet to use IceBerg (the Pharo's git integration). My guess, would be to "(re-)initialize it": (Smalltalk at: #LGitLibrary) initialize.
For more information, I recommend reading these: pharo's iceberg and some Pharo project that uses git like pharo-contributor and checking blog pharoweekly (for some information about the pharo-contributor) - https://pharoweekly.wordpress.com/2018/04/24/pharo-contributor-to-contribute-to-pharo.
You may want to use some guide "How to use git and github with Pharo". Which was done by Peter Uhnak (you can find him on SO).
I had the similar problem and I needed to build libgit2 library from source using this instructions. The basic build didn't work because Pharo wasn't able to initialize the library. I compiled it again with parameter -DSTDCALL=ON an it works.

Error installing purescript-list

I'm new to Purescript and am following the tutorial for installation. Purescript itself is working and I can start the CLI using pulp psci, but installing purescript-list runs into trouble.
Having entered the command bower install purescript-lists --save, I get a long list of package names, but when it gets to purescript-eff and purescript-prelude I run into some version conflicts:
bower purescript-eff#^2.0.0 cached https://github.com/purescript/purescript-eff.git#2.0.0
bower purescript-eff#^2.0.0 validate 2.0.0 against https://github.com/purescript/purescript-eff.git#^2.0.0
Unable to find a suitable version for purescript-eff, please choose one by typing one of the numbers below:
1) purescript-eff#^1.0.0 which resolved to 1.0.0 and is required by purescript-console#1.0.0
2) purescript-eff#^2.0.0 which resolved to 2.0.0 and is required by purescript-st#2.0.0
Prefix the choice with ! to persist it to bower.json
? Answer
A similar message is shown for purescript-prelude. No matter which options I choose, both pulp build and pulp run fail with:
$ pulp build
* Building project in /Developer/purescript/training1
Error found:
in module PSCI.Support
at /Developer/purescript/training1/bower_components/purescript-psci-support/src/PSCI/Support.purs line 10, column 34 - line 10, column 53
Cannot import value unsafeInterleaveEff from module Control.Monad.Eff.Unsafe
It either does not exist or the module does not export it.
See https://github.com/purescript/purescript/wiki/Error-Code-UnknownImport for more information,
or to contribute content related to this error.
Compiling PSCI.Support
* ERROR: Subcommand terminated with exit code 1
What have I missed here?
Thanks
Chris W
If you are using psc version 0.10.* you should go with prelude, lists and eff v2*.
If you are using psc version 0.9.* you should go with prelude, lists and eff v1*.
If you are using psc 0.10.* you might want to update pulp to version 9.1.0
The problem occurs due to breaking changes between psc 0.9 and 0.10 and the relevant libraries. by writing bower install purescript-lists --save you are asking bower for the latest dependencies which conflict with the dependency versions specified in your bower.json.

Statet in eclipse does not find the rj package

I cannot get Eclipse, Statet, and R to work together. I receive an error when I launch R:
Launching the R Console was cancelled, because it seems starting the R engine failed.
Please make sure that R package 'rj' (2.0 or compatible) is installed and that the R library paths are set correctly for the R environment configuration 'R test'.
I have installed Eclipse Luna (64 bit), Statet, Java 1.8.0_25 (64bit) and R 3.1.2 (64bit). I am running on windows 7 (64bit). As required I installed the packages "rj" and "rj.gd" using:
install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-2.0")
It installed fine:
packageDescription("rj")
Encoding: UTF-8
Package: rj
Version: 2.0.2-1
Title: RJ - R Package for high-level Java-R library RJ
Author: Stephan Wahlbrink, Tobias Verbeke, low-level R binding based on the JRI library by Simon Urbanek
Maintainer: Stephan Wahlbrink <stephan.wahlbrink#walware.de>
Depends: R (>= 2.11.0)
Suggests: rj.gd
SystemRequirements: java
Description: Server implementation and R functions for the high-level Java-R library RJ. The package also includes callback functions for StatET. It is shipped with an adapted version of the JRI library. The package can be used only when R was loaded via RJ.
License: LGPL (>= 2.1)
URL: http://www.walware.de/goto/opensource
Packaged: 2014-07-11 15:43:15 UTC; build
Built: R 3.1.1; x86_64-w64-mingw32; 2014-07-11 15:47:59 UTC; windows
-- File: c:/~/R/win-library/3.1/rj/Meta/package.rds
I made sure that the library path is correct. I am a bit at a loss, how to proceed.
thanks for the help.
Christoph
Whilst digging around in the R-environment configuration (Run -> Run configurations... -> R config -> Configure), I tried something which worked:
Instead of specifying the user library link under "R_LIBS_USER", add an entry under "R_LIBS_SITE".
It works fine after that.
(I would have included visual pointers, but no rep)
I set R_LIBS_USER to the /library/ folder in the R environment and it worked fine.

How do I install XML::Xerces?

Please see Part 2 which list latest errors while installing module continued post.
Normally when I try to install XML::Xerces CPAN module using standard cpan> install XML::Xercers than I get following error message after some processing:
XML-Xerces-2.7.0-0/samples/SEnumVal.pl
...
XML-Xerces-2.7.0-0/postSource.pl
XML-Xerces-2.7.0-0/xerces-headers.txt
Removing previously used /home/adoshi/.cpan/build/XML-Xerces-2.7.0-0
CPAN.pm: Going to build J/JA/JASONS/XML-Xerces-2.7.0-0.tar.gz
WARNING
You have not defined any of the following environment variables:
XERCESCROOT
XERCES_LIB
XERCES_INCLUDE
These instruct me how to locate the Xerces header files, and the
Xerces dynamic library. If they are installed in a standard system
directory, I will located them without those variables.
However, if they have been installed in a non-standard location
(e.g. '/usr/include/xerces'), then I will need help. See the README
for more info.
Proceeding ...
WARNING
You have not defined any of the following environment variables:
XERCESCROOT
XERCES_CONFIG
Without these I cannot find the config.status file that was used to
build your Xerces-C library. Without that file, I may not be able to properly
build the C++ glue files that come with Xerces.pm.
Proceeding anyway ...
Couldn't find XercesVersion.hpp in your include directory at Makefile.PL line 1 88.
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install
After Setting Enviornment Variables to /home/username/XML-Xerces-2.7.0-0/XML-Xerces-2.7.0-0/Xerces.pm, note here am not sure whether I should point my environment variable to Xerces.pm or Xerces.cpp or Xerces-extra.pm or Xerces.i, but for now am pointing environment variables to /home/username/XML-Xerces-2.7.0-0/XML-Xerces-2.7.0-0/Xerces.pm
After setting environment variables as mentioned and entering cpan>install XML::Xerces I get following message:
CPAN: Storable loaded ok
Going to read /home/username/.cpan/Metadata
Database was generated on Fri, 16 Oct 2009 18:27:06 GMT
Running install for module XML::Xerces
Running make for J/JA/JASONS/XML-Xerces-2.7.0-0.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for /home/adoshi/.cpan/sources/authors/id/J/JA/JASONS/XML-Xerces-2.7.0-0.tar.gz ok
Scanning cache /home/adoshi/.cpan/build for sizes
XML-Xerces-2.7.0-0/
...
XML-Xerces-2.7.0-0/postSource.pl
XML-Xerces-2.7.0-0/xerces-headers.txt
Removing previously used /home/adoshi/.cpan/build/XML-Xerces-2.7.0-0
CPAN.pm: Going to build J/JA/JASONS/XML-Xerces-2.7.0-0.tar.gz
Using XERCES_LIB = /home/adoshi/XML-Xerces-2.7.0-0/XML-Xerces-2.7.0-0/Xerces.pm
using XERCES_CONFIG: /home/adoshi/XML-Xerces-2.7.0-0/XML-Xerces-2.7.0-0/Xerces.pm
- Found CXX =
- Found CXXFLAGS =
- Found LDFLAGS =
Couldn't find XercesVersion.hpp in your include directory at Makefile.PL line 188, <CONF> line 6823.
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install
Note: I have tried downloading XML::Xercesand trying to again install it, both manually as well as using CPAN but am getting above mentioned error message.
What can be the possible reason and what can be suggested turn around to take care of this issue ?
Update: Even after building Xerces-C, XML::Xerces module is not building and am getting following error message.
[adoshi#upc01.dev XML-Xerces-2.7.0-0]$ perl Makefile.PL
Using XERCES_LIB = /adoshi/lib
Using XERCES_INCLUDE = /adoshi/include/xerces
WARNING
You have defined the XERCESCROOT variable, but the file:
XERCESCROOT/src/xercesc/config.status
does not seem to point to the config.status file that was used to
build your Xerces-C library. Without that file, I may not be able to
properly build the C++ glue files that come with Xerces.pm.
Proceeding anyway ...
Couldn't find XercesVersion.hpp in your include directory /adoshi/include/xerces at Makefile.PL line 188.
Update2Here is the error which am getting, it says there is somekind of version mismatch.
Using XERCES_LIB = /home/adoshi/XML-Parser/Parser2/xerces-c_2_8_0-hppa-hpux-acc_3(1)/xerces-c_2_8_0-hppa-hpux-acc_3/lib
Using XERCES_INCLUDE = /home/adoshi/XML-Parser/Parser2/xerces-c_2_8_0-hppa-hpux-acc_3(1)/xerces-c_2_8_0-hppa-hpux-acc_3/include
WARNING
You have defined the XERCESCROOT variable, but the file:
XERCESCROOT/src/xercesc/config.status
does not seem to point to the config.status file that was used to
build your Xerces-C library. Without that file, I may not be able to
properly build the C++ glue files that come with Xerces.pm.
Proceeding anyway ...
Using Xerces-C version info from /home/adoshi/XML-Parser/Parser2/xerces-c_2_8_0-hppa-hpux-acc_3(1)/xerces-c_2_8_0-hppa-hpux-acc_3/include/xercesc/util/XercesVersion.hpp
*** Version Mismatch ***
You are attempt to build XML::Xerces-2.7.0-0 using Xerces-C-2.8.0,
this will most likely fail, so I am aborting.
You must use Xerces-C-2.7.0
Here's a general rule: any environment variable that is named something like "ROOT" is asking for a directory, not a file.
However, it does not appear that you have installed the Xerces library, which is necessary before you install the perl module. I'll quote some portions of the output you provided, as the hint you missed as to what to do next:
"...These instruct me how to locate the Xerces header files, and the Xerces dynamic library..."
"Without these I cannot find the config.status file that was used to
build your Xerces-C library"
So, did you install Xerces-C? You'll have much better results installing the Perl module after that.
Did you try using the PPM to install XML::Xerces?