Julia: remove a package and all its dependencies? - julia

After adding a package, e.g. MarketData, with:
Pkg.add("MarketData")
which also installs dependencies:
INFO: Installing BufferedStreams v0.4.0
INFO: Installing Codecs v0.4.0
...
how can I remove or uninstall the package and all its dependencies?

From the documentation:
Pkg.rm("MarketData")
rm(pkg)
Remove all requirement entries for pkg from Pkg.dir("REQUIRE") and call Pkg.resolve().
This also removes dependencies:
INFO: Removing BufferedStreams v0.4.0
INFO: Removing Codecs v0.4.0
...

Step 1: Press ] to go to package manager .
Step 2: Type rm MarketData
Tested on v1.6

Related

- jms/payment-core-bundle[dev-master, 1.4.0, ..., 1.4.1] require doctrine/common ~2.3 -> found doctrine/common[2.3.0-BETA1, ..., 2.13.x-dev]

I can not install JMSPaymentCoreBundle here are the errors. How to fix it?
Problem 1
- jms/payment-core-bundle[dev-master, 1.4.0, ..., 1.4.1] require doctrine/common ~2.3 -> found doctrine/common[2.3.0-BETA1, ..., 2.13.x-dev]
but the package is fixed to 3.1.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument
for the update command.
- jms/payment-core-bundle 1.4.x-dev is an alias of jms/payment-core-bundle dev-master and thus requires it to be installed too.
- Root composer.json requires jms/payment-core-bundle ^1.4 -> satisfiable by jms/payment-core-bundle[1.4.0, 1.4.1, 1.4.x-dev (alias of dev-m
aster)].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Deprecated debug package:

I have found a PHP Notice in the logs:
[info] User Deprecated: The "Symfony\Component\Debug\ErrorHandler" class is deprecated since Symfony 4.4, use "Symfony\Component\ErrorHandler\ErrorHandler" instead.
This code is invoked from Vendor folder, so I have been checking what package is using this package. I have found that the package symfony/monolog-bundle is the problem.
I am using:
https://packagist.org/packages/symfony/monolog-bundle#v3.6.0
It requires: https://packagist.org/packages/symfony/http-kernel#v4.3.11
It requires the problematic package: https://packagist.org/packages/symfony/debug
I have been trying to upgrade the package http-kernel to a newest version which not using symfony debug, it means from http-kernel>v5.0
I am executing this code and receiving this error:
MacBook-Pro-de-Pablo-Garces:cp-igw pgarces$ composer require "symfony/error-handler:5.0.*"
./composer.json has been updated
Running composer update symfony/error-handler
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/http-kernel[v4.4.0, ..., v4.4.18] require symfony/error-handler ^4.4 -> found symfony/error-handler[v4.4.0, ..., v4.4.18] but it conflicts with your root composer.json require (5.0.*).
- Root composer.json requires symfony/http-kernel ^4.4 -> satisfiable by symfony/http-kernel[v4.4.0, ..., v4.4.18].
How can I solve it?

Julia package install fail with Please specify by known `name=uuid`

I have an error when trying to install any Julia package:
Pkg.add("Combinatorics")
Cloning default registries into `~/.julia`
Cloning registry from "https://github.com/JuliaRegistries/General.git"
Added registry `General` to `~/.julia/registries/General`
Resolving package versions...
ERROR: The following package names could not be resolved:
* Logging (56ddb016-857b-54e1-b83d-db4d58db5568 in manifest but not in project)
Please specify by known `name=uuid`.
What can be done to fix this?
I could fix this problem after the following two steps:
First: (not sure if absolutely needed)
rm(joinpath(homedir(), ".julia", "registries"); recursive=true)
Second: installing the package mentioned as missing in the error message:
Pkg.add("Logging")
Resolving package versions...
Installed MappedArrays ─────────── v0.2.2
Installed IntervalSets ─────────── v0.3.2
Installed PDMats ───────────────── v0.9.10
Installed ColorVectorSpace ─────── v0.7.1
etc
Then my Pkg install worked:
Pkg.add("Combinatorics")
Resolving package versions...
Installed Polynomials ─ v0.6.0
Updating `~/.julia/environments/v1.1/Project.toml`
[861a8166] + Combinatorics v1.0.0
Updating `~/.julia/environments/v1.1/Manifest.toml`
[861a8166] + Combinatorics v1.0.0
[f27b6e38] + Polynomials v0.6.0
julia> using Combinatorics
[ Info: Precompiling Combinatorics [861a8166-3701-5b0c-9a16-15d98fcdc6aa]

How can I use an unregistered package in Julia?

I want to use a package I found online, but I get the following error:
(Example) pkg> add Unregistered
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
ERROR: The following package names could not be resolved:
* Unregistered (not found in project, manifest or registry)
Please specify by known `name=uuid`.
I have seen others use the add command, but it does not seem to work in this case.
To add an unregistered package, refer to it by URL:
(Example) pkg> add https://github.com/00vareladavid/Unregistered.jl
Updating git-repo `https://github.com/00vareladavid/Unregistered.jl`
Updating git-repo `https://github.com/00vareladavid/Unregistered.jl`
Resolving package versions...
Updating `~/.julia/environments/Example/Project.toml`
[dcb67f36] + Unregistered v0.2.0 #master (https://github.com/00vareladavid/Unregistered.jl)
Updating `~/.julia/environments/Example/Manifest.toml`
[7876af07] + Example v0.5.3
[dcb67f36] + Unregistered v0.2.0 #master (https://github.com/00vareladavid/Unregistered.jl)
Pkg will automatically install its dependencies.
After you have added the package, you can use it normally:
julia> import Unregistered
[ Info: Precompiling Unregistered [dcb67f36-efa0-11e8-0cef-2fc465ed98ae]
Note: Packages must have a toplevel Project.toml file with name, UUID, and version fields.

R Travis CI error: Package suggested but not available: ‘ridge’

I am trying to run Travis CI for one of my R packages. The problem is the build fails with an error stating that one dependency of the package is not available (the package named 'ridge')
Here the error log:
* checking extension type ... Package
* this is package ‘imputeR’ version ‘2.1’
* checking package namespace information ... OK
* checking package dependencies ... ERROR
Package suggested but not available: ‘ridge’
The suggested packages are required for a complete check.
Checking can be attempted without them by setting the environment
variable _R_CHECK_FORCE_SUGGESTS_ to a false value.
See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’
manual.
* DONE
Status: 1 ERROR
See
‘/home/travis/build/SteffenMoritz/imputeR/imputeR.Rcheck/00check.log’
for details.
0.38schecking package dependencies ... ERROR
Package suggested but not available: ‘ridge’
Here is also the link to the Travis built:
https://travis-ci.org/SteffenMoritz/imputeR/builds/436334069
The package that is not available to Travis is a normal package that is currently on CRAN. Could this be related to Gnu Scientific Library version >= 1.14 being required for ridge..? Can I somehow solve this problem?
You are right by saying that it is because ridge requires an external library (Gnu Scientific Library) that is not installed by default on travis.
Travis CI docs explain in detail how you can install external packages.
In your case, you need to add
addons:
apt:
packages: libgsl0-dev
to your .travis.yml
Found a solution that let's at least TRAVIS complete the check
You can add this to the Travis configuration yaml file:
env:
global:
- _R_CHECK_FORCE_SUGGESTS_: false
Downside as far as I understand is: everything which includes suggested packages is not checked at all. So the solution is not completely satisfying.

Resources