[R-pkg-devel] Problem with package using reticulate (and Config in DESCRIPTION)

Kevin Ushey kev|nu@hey @end|ng |rom gm@||@com
Sat Jan 11 04:18:32 CET 2020


Note that by calling py_module_available() in your .onLoad(), as done here:

https://github.com/r-cas/caracas/blob/418b3a552de0203c3d2f960f0e4235f7891db71d/R/init.R#L51

you are forcing reticulate to initialize the Python session eagerly
when your package is loaded (so before the user might've had a chance
to configure which version of Python should be loaded as well).

Please see:

https://rstudio.github.io/reticulate/articles/package.html

and be very careful that loading your package does not inadvertently
force reticulate to initialize Python before the user has requested
it.

Re: Config/reticulate, I plan to submit a patch to reticulate soon to
ensure that environment configuration does not happen
non-interactively in this way.

Thanks,
Kevin

On Fri, Jan 10, 2020 at 2:55 AM Mikkel Meyer Andersen <mikl using math.aau.dk> wrote:
>
> I finally got this to work by removing the Config part of DESCRIPTION
> and reverting back to functionality inside .onLoad(). Please see code
> that does not trigger any warnings/errors here:
>
> https://github.com/r-cas/caracas/tree/418b3a552de0203c3d2f960f0e4235f7891db71d
>
> Cheers,
> Mikkel.
>
> tor, 09 01 2020 kl. 18:20 +0100, skrev Mikkel Meyer Andersen:
> > Hello,
> >
> > I have submitted a package (source at
> > https://github.com/r-cas/caracas)
> > depending on reticulate to CRAN and it failed:
> >
> > package caracas_0.0.1.tar.gz does not pass the incoming checks
> > automatically, please see the following pre-tests:
> > Windows: <
> >
> https://win-builder.r-project.org/incoming_pretest/caracas_0.0.1_20200108_193959/Windows/00check.log
> > >
> >
> > Status: 6 WARNINGs, 6 NOTEs
> > Debian: <
> >
> https://win-builder.r-project.org/incoming_pretest/caracas_0.0.1_20200108_193959/Debian/00check.log
> > >
> >
> > Status: 1 ERROR, 5 WARNINGs, 6 NOTEs
> >
> > More details are given in the directory:
> > <
> >
> https://win-builder.r-project.org/incoming_pretest/caracas_0.0.1_20200108_193959/
> > >
> >
> > As far as I can read, the NOTE's and WARNING's are related to these:
> >
> > /usr/bin/python: No module named pip
> >
> > error: could not find a Python environment for /usr/bin/python
> >
> > Warning: cannot find svn location for rst2pdf===0.93.dev-r0
> > You are using pip version 9.0.1, however version 19.3.1 is available.
> > You should consider upgrading via the 'python -m pip install --
> > upgrade
> > pip' command.
> >
> > Can anybody see what the error in my package code is?
> >
> > Cheers,
> > Mikkel.
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list