nlmixr2 / nonmem2rx

nonmem2rx
https://nlmixr2.github.io/nonmem2rx/
9 stars 0 forks source link

main branch does not load #156

Closed philipdelff closed 1 year ago

philipdelff commented 1 year ago

I get an error when trying to load nonmem2rx. The problem seems to be an assign function ‘model<-’ not correctly loaded from rxode2.

First I tried just instal.package("nonmem2rx") It tried installing this: https://cloud.r-project.org/src/contrib/nonmem2rx_0.1.2.tar.gz

This is the last part of the returned messages:

installing to x86_64-pc-linux-gnu-library/4.2/00LOCK-nonmem2rx/00new/nonmem2rx/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Error: object ‘model<-’ is not exported by 'namespace:rxode2'
Execution halted
ERROR: lazy loading failed for package ‘nonmem2rx’

Then I cloned the github main branch (revision 0b6da452b00b66ac362557078dd3041244e06a70 from July 3). The issue seems to persist:

   ** checking absolute paths in shared objects and dynamic libraries
─  DONE (nonmem2rx)
Error in `load_all()`:
! Failed to load R/reexport.R
Caused by error:
! 'model<-' is not an exported object from 'namespace:rxode2'
Run `rlang::last_trace()` to see where the error occurred.
Warning message:
object ‘model<-’ is not exported by 'namespace:rxode2' 
> rlang::last_trace()
<error/rlang_error>
Error in `load_all()`:
! Failed to load R/reexport.R
Caused by error:
! 'model<-' is not an exported object from 'namespace:rxode2'
---
Backtrace:
     ▆
  1. └─utils (local) .ess.ns_eval(...)
  2.   └─utils (local) .ess.ns_source(...)
  3.     └─utils (local) .ess.ns_evalSource(...)
  4.       └─utils (local) .ess.source(...)
  5.         └─base (local) ss(...)
  6.           ├─base::withVisible(eval(ei, envir))
  7.           └─base::eval(ei, envir)
  8.             └─base::eval(ei, envir)
  9.               └─devtools::load_all("~/wdirs/nonmem2rx") at /tmp/NMsim_VarCov.R!OjNnqe:1:0
 10.                 └─pkgload::load_all(...)
 11.                   └─pkgload::load_code(path, quiet = quiet)
 12.                     ├─withr (local) withr_with_dir(path, source_many(paths, encoding, env))
 13.                     │ └─base::force(code)
 14.                     └─pkgload:::source_many(paths, encoding, env)
 15.                       ├─rlang::try_fetch(...)
 16.                       │ ├─base::tryCatch(...)
 17.                       │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 18.                       │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 19.                       │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 20.                       │ └─base::withCallingHandlers(...)
 21.                       └─pkgload:::source_one(file, encoding, envir = envir)
 22.                         └─base::eval(exprs[i], envir)
 23.                           └─base::eval(exprs[i], envir)
Run rlang::last_trace(drop = FALSE) to see 5 hidden frames.
billdenney commented 1 year ago

I think that you will need to install the current development version of rxode2 for the development version of nonmem2rx to work. Can you please try installing it using the instructions here: https://github.com/nlmixr2/rxode2#installation

And, you may want to go ahead and install the development version of the other nlmixr2 packages while you're at it: https://github.com/nlmixr2/nlmixr2#installation (These are not required for nonmem2rx, but they will bring additional functionality and bug fixes.)

philipdelff commented 1 year ago

I see, thanks. But as described above, even the CRAN version of nonmem2rx does not install.

billdenney commented 1 year ago

The CRAN versions should all be self-consistent. Can you confirm that you're running the current version of CRAN rxode2, version 2.0.13? We may need to set a minimum rxode2 version requirement for nonmem2rx.

mattfidler commented 1 year ago

Hi @philipdelff

Thanks for your patience, for the model<- to work you need at least rxode2 2.0.12. I forgot to add that explicitly as a dependency .

Matt

mattfidler commented 1 year ago

I put the explicit requirements in the description file

philipdelff commented 1 year ago

Thanks @mattfidler and @billdenney !