Run Pkg.instantiate() error when importing julia package - julia

I have added a package Relief.jl to my environment. I have also checked if it's available by typing stand it's listed under available packages for the environment. However when I type using Relief I get the following error,
ERROR: ArgumentError: Package Relief [e59a39ae-ffc4-11ea-35a5-2b2996f35250] is required but does not seem to be installed:
- Run Pkg.instantiate() to install all recorded dependencies.
Any ideas what I should do to resolve this?

You need to run the command: ] build "name of package" in the terminal. This should fix the problem.
(Without the speech marks. That is just to highlight its a name)

Related

Cannot install any package in Julia

I had used Julia some months back for a project, and didn't use it since. I hadn't faced problems back then. But now, I absolutely am not able to install any package.
(#v1.5) pkg> add Distributions
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Distributions [31c24e10]:
Distributions [31c24e10] log:
├─Distributions [31c24e10] has no known versions!
└─restricted to versions * by an explicit requirement — no versions left
Any package I install, I am getting the same error. How do I fix it?
This is the status of Pkg:
(#v1.5) pkg> status
Status `C:\Users\jaine\.julia\environments\v1.5\Project.toml`
[6e4b80f9] BenchmarkTools v0.5.0
[7073ff75] IJulia v1.21.2
[91a5bcdd] Plots v1.6.0
[438e738f] PyCall v1.91.4
[d330b81b] PyPlot v2.9.0
[2913bbd2] StatsBase v0.33.0
Given
├─Distributions [31c24e10] has no known versions!
it looks like you have a missing or corrupt package registry. The package manager will reinstall it for you if you delete .julia/registries and try to add the package again.
You can do this from within julia
rm(joinpath(homedir(), ".julia", "registries"), recursive=true, force=true)
These are indeed some of the more tricky situations to resolve so please bear with me as we work through this.
If you are not familiar with the basics of the package manager, it's worth a quick read to check out: https://julialang.github.io/Pkg.jl/v1/getting-started/
Assuming you are now in the Julia Repl, my general work flow for these issues is to remove everything it warns me about. The core problem here is that one of your existing packages is saying it needs a specific version of Distributions.jl but it's not able to add it. So, the first step would be to enter the pkg manager by doing ] and type rm Distributions.
Then, while still in the pkg mode, do resolve and add Distributions.
So the process is to just remove each package the Repl complains about until it stops complaining.
Note: If you run into something like this again, the worst-case scenario is to remove the project and manifest files for the specific Julia version you are using. If you navigate to ".julia/environments" you should be able to completely reset the Julia Env for a specific version there (that way you don't need to actually reinstall Julia).

Trying to add IJulia via the REPL: Unsatisfiable requirements detected for package

I keep trying to add IJulia in the REPL, and I keep getting this error message:
I tried installing JSON directly, but the REPL would say "The following packages names could not be resolved".
If it helps, I'm running a Windows 10 laptop with julia 1.0.5
Is there a fix to this? Should I install an earlier version to julia?
Appreciate the time.
It seems like you have outdated registries locally.
The registries are ~/.julia/registries, message like The following package names could not be resolved usually suggests that registry are not updated or somehow corrupted.
Delete them (the directory ~/.julia/registries/General) and then adding packages should cause the General registry to be downloaded, the newest version. Then you should be able to add IJulia without problem.
More people encountered this problem with messed up registry, see https://discourse.julialang.org/t/registry-failed-to-update/17840/10

ERROR: expected package `PkgAuthentication [4722fa14]` to be registered

I am using JuliaPro v1.4 on Windows 10. I was trying to install a package but the REPL got stuck so I interrupted it. Since then I'm no longer able to install any package due to this error. Any ideas?
If you are in the right directory (where the manifest/project file are), just doing up and resolve in the package manager will resolve this.
In the REPL (in the repo where you'd like to install the package):
Switch to "Pkg mode" by typing ]
Type up + enter
Type resolve + enter
Try re-installing the desired package

Why do I get a syntax error in devtools::install_github?

I am new in working with linux. I am trying to analyse sequencing data using dropEst pipeline https://github.com/hms-dbmi/dropEst#dropreport. I want to run the DropReport and for that I need to install dropEstR package.
I tried by :
devtools::install_github('hms-dbmi/dropEst/dropestr' , dependencies = T)
as they suggest and I get as an error:
bash: syntax error near unexpected token
`'hms-dbmi/dropEst/dropestr','
Do you have any idea what should I do differently?
I think you are using the "wrong" shell. You have to use R/RStudio, when you want to use the devtools package. From CRAN:
Title Tools to Make Developing R Packages Easier
I just tried you command in RStudio but installation fails in the end:
ERROR: dependency 'Rcpp' is not available for package 'dropestr'
* removing 'C:/R/R-3.4.2/library/dropestr'
Installation failed: Command failed (1)
You have to run such script on RStudio for R. Import your project here and run it.
You can download it from enter link description here
Happy Coding.

Travis CI R package error in documentation

Greetings and Salutations,
I recently hooked up a github repo containing an R package to Travis CI. I thought the repository would be built fine, however, there are several check errors that arise which I cannot replicate on local installs of Windows, OS X, or Ubuntu 14.04 LTS.
The errors are originating off of functions that share the following in common:
Have roxygen2 help documentation that is coded with the #keyword internal.
Are written using Rcpp / RcppArmadillo.
Specifically, I receive the following warning from Travis CI:
Functions or methods with usage in documentation object 'internal
function here' but not in code:
This is not particularly problematic as it is a warning. A previous post addressed a different form of this example using #method and #export. However, the Rcpp functions are not of an OO class (S3/S4/RR).
However, when Travis CI starts to evaluate the package's examples, this warning then becomes an error:
Error: could not find function "internal function here"
and causes the build to fail. Though, the build itself should pass the check since the function does exist.
Travis CI is configured using the recommended guidelines in the following manner:
language: r
sudo: required
warnings_are_errors: true
r_packages:
- ggplot2
- devtools
- RcppArmadillo
- knitr
- gridExtra
- grid
r_build_args: "--no-build-vignettes"
r_check_args: "--no-build-vignettes --as-cran"
Note The --no-build-vignettes was added since Travis would error upon building them since the R code calls one of the internal functions listed in the docs.
Here is I believe the latest public facing build:
Travis CI report (v1.0.1)
And the results from the first version on CRAN:
CRAN report (v1.0.0)
Any thoughts would be welcome.
I can replicate the warnings/errors on my laptop (running OS X). I'm also pretty sure that if you check out your repository, build the tar ball and then run R CMD check on it, you will get the same warnings/errors as on Travis CI. (I'm assuming you only checked your package from within R Studio.)
As far as I can tell, the problem is that you added R/RcppExports.R and src/RcppExports.cpp to your .gitignore, which means these files are not on GitHub. Travis CI does not run Rcpp::compileAttributes for you.
There are two simple solutions:
Remove R/RcppExports.R and src/RcppExports.cpp from .gitignore and commit them to GitHub with everything else. That sort of makes sense, because those files are in fact part of your package and you should not necessarily expect an end-user to compile them before installing your package. I think this is the proper way to deal with this.
Add a line to your travis.yml to run Rcpp::compileAttributes before building the package, e.g. Rscript -e "Rcpp::compileAttributes()".

Resources