Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package dependency error: there is no package called chron #1891

Closed
geneorama opened this issue Oct 25, 2016 · 8 comments
Closed

Package dependency error: there is no package called chron #1891

geneorama opened this issue Oct 25, 2016 · 8 comments

Comments

@geneorama
Copy link

I use data.table in my personal package geneorama. https://github.com/geneorama/geneorama

I am following the instructions in FAQ 6.9 regarding the dependency. I have data.table imported in my NAMESPACE file and listed as a dependency in DESCRIPTION. However when I try to install my package on a new machine I get the following error:

> devtools::install_github("geneorama/geneorama")
Downloading GitHub repo geneorama/geneorama@master
from URL https://api.github.com/repos/geneorama/geneorama/zipball/master
Installing geneorama
"C:/R/R-3.3.1/bin/i386/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  "C:/Users/375492/AppData/Local/Temp/RtmpwxvG5u/devtools2e0c5ff240ce/geneorama-geneorama-33f1225"  \
  --library="C:/R/R-3.3.1/library" --install-tests 

* installing *source* package 'geneorama' ...
** R
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called 'chron'
Error : package 'data.table' could not be loaded
ERROR: lazy loading failed for package 'geneorama'
* removing 'C:/R/R-3.3.1/library/geneorama'
Error: Command failed (1)

I just started having this problem pretty recently, in the last few months. At first I thought it was an error in my package, but I don't think so anymore.

This might be the same problem as issue #1520, but it's hard to tell without more detail in that issue.

Yes, I can probably install data.table manually by telling install.packages to install the dependencies, but this doesn't help me install my package. In fact devtools::install_github("geneorama/geneorama", dependencies = TRUE) produces the same error.

Yes, I could make chron a dependency of my package and it might solve the problem, but I shouldn't have to do that.

If you look carefully you may notice that my R is installed to C:\R. That's a work around for some weird bug that we have on my employer's current standard image. I don't think it's related, but for some reason in some cases we can't escape the space in Program Files in Windows 7.

If I missed something that's already been solved, I apologize in advance. I did do a lot of research before posting.

@jangorecki
Copy link
Member

jangorecki commented Oct 25, 2016

What data.table version do you use? In 1.9.6 it still imports chron.

@geneorama
Copy link
Author

This error occurs before I install data.table. I was expecting that it would be installed as a dependency of geneorama, but the dependency installation fails because chron is not available.

Thinking about this again, I can't see I'm the only one with this problem. If this is a real bug then the CRAN checks should have failed for other packages that depend on data.table. So it's probably me doing something wrong.

@mattdowle
Copy link
Member

mattdowle commented Nov 7, 2016

Hope you managed to solve this one ok?

@geneorama
Copy link
Author

geneorama commented Nov 8, 2016

The problem is "solved" if I install chron before installing my package (which is what I've done). However I shouldn't have to install chron first.

I think the issue started when chron was moved from imports to suggests d6b569c

I like to be able to tell users "clone this project, install geneorama", and run it. Installing geneorama would install data.table (because it's a dependency), and I use a geneorama function loadinstall_libraries to load libraries. The advantage of loadinstall_libraries is that it installs libraries if they're missing. So, for a new user they can run my code by installing devtools and then using that to install geneorama. (This is a convenience for me on new machines more often that new users.)

Now I have to tell users to install chron then install devtools then install geneorama so that they'll have the data.table dependency (and other functions that I use).

Technically this breaks my initialization steps of several projects, but practically speaking it's more of an inconvenience.

I'm just surprised that nobody else has noticed this... but I'm guessing that that most users of data.table dependent packages already data.table installed. My second guess is that I am doing something that's barely wrong in my NAMESPACE file or in how I specify DEPENDS / SUGGESTS / IMPORTS or whatever else.

@jangorecki
Copy link
Member

jangorecki commented Nov 8, 2016

data.table is not dependent on chron since commit you refer. Suggested dependencies are optional, and by default are not installed by install.packages (to change this use dependencies=TRUE). If you are not using chron you don't have to install it at all (after mentioned commit). Not sure why you are not using install.packages which resolve dependencies well. I don't know the helper installer you are using, but from your description it looks like it fetches dependency info from CRAN (not our repo), thus forces you to install chron.

@MichaelChirico
Copy link
Member

Closing this, chron hasn't been a dependency in some time (though still in Suggests)

@geneorama
Copy link
Author

Thanks @MichaelChirico
I didn't realize this was still open

@mattdowle
Copy link
Member

And chron is now completely removed from data.table as from 1.11.2 (8 May 2018), not even in Suggests.

as.chron methods for IDate and ITime have been removed, #2825. as.chron still works since IDate inherits from Date. We are not sure why we had specific methods in the first place. It may have been from a time when IDate did not inherit from Date, perhaps. Note that we don’t use chron ourselves in our own work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants