• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Install a local package in the default environment with project.toml dependency

Resolved: Install a local package in the default environment with project.toml dependency

0
By Isaac Tonny on 04/04/2023 Issue
Share
Facebook Twitter LinkedIn

In this post, we will see how to resolve Install a local package in the default environment with project.toml dependency

Question:

I want to install a local package (let’s say foo.jl) in the default environment because I don’t want to activate the package environment (Pkg.activate("\path\to\foo.jl")) every time.
However, when I try to install the package by Pkg.add(path=\path\to\foo\), it seems that the project.toml of the foo.jl was not followed. Specifically, foo.jl requires "JuMP=1.5.0" in the project.toml compatibility module, but "JuMP=1.9.0" was installed and was added to the project.toml of the default environment.
Could anyone please explain how the process works? I know I can use “instantiate” to reproduce the environment, but it creates a project environment and installs the package instead of installing the package in the default environment.

Best Answer:

Julia uses semantic versioning for package compatibility.
If you write JuMP="1.5.0" the acceptable version include [1.5.0 - 2.0.0) (note that the range is open on the right side). Since 1.9.0 is currently the latest version, it gets installed and this is the correct expected behavior.
Most likely what you wanted is:
such line would ensure that exactly the version 1.5.0 gets installed.
The way you are adding the packages seems to be correct.
For more details on semantic versioning see: https://pkgdocs.julialang.org/v1/compatibility/

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

julia julia-jump
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to stop a thread that has a blocking function from easygui in python

05/04/2023

Resolved: Removing null keys from a json array of objects

05/04/2023

Resolved: How can I generate at compile-time a separate OpenAPI Swagger.json file for each Controller in my ASP.NET project?

05/04/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.