spine-tools / Spine-Toolbox

Spine Toolbox is an open source Python package to manage data, scenarios and workflows for modelling and simulation. You can have your local workflow, but work as a team through version control and SQL databases.
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
73 stars 18 forks source link

Wrong Julia used by SpineOpt after julia's update #2994

Closed tbaptistal closed 3 weeks ago

tbaptistal commented 3 weeks ago

I downloaded SpineToolBox and downloaded Julia (1.10) and SpineOpt from the Spinetoolbox settings < tool interface.

But I needed to access the latest version of SpineOpt (which was not published at the time, and so I had to directly clone the repository). To stay coherent with the same installation tutorial, I removed Julia from my laptop and downloaded it again with python. I cloned SpineOpt repository and followed the installation procedure. Then I linked my new Julia (1.11) and the environment to get the latest version of SpineOpt: image

New project would generate the SpineOpt blocks following the right path to Julia 1.11 and the new SpineOpt in the Julia environment. image

But old project like as follow, would continue to use julia 1.10. image

Even new blocks generated would follow the julia 1.10: image

My general settings in this old project are not changed as follow: image

To remove this bug from the block in this old project, I had to manually change the specification of SpineOpt blocks by changing the executable and the project in the block: image

datejada commented 3 weeks ago

Hi @tbaptistal, Thanks for reporting the issue. It seems to me that it is more of a SpineToolbox issue than a SpineOpt one. @soininen, What do you think?

soininen commented 3 weeks ago

Right. Transferred the issue to Spine-Toolbox.

ptsavol commented 3 weeks ago

TLDR: This is probably fixed but please reopen if you find any other problems related to this.

I think I know what happened here. The directory C:\<user_dir>\AppData\Local\julias\bin contains symlinks to Julias that you have installed using Jill (Spine Toolbox's Settings->Tools->Install Julia button uses Jill too). When You (@tbaptistal) removed Julia 1.10, I assume that the symlink for that Julia was not removed. Then you installed Julia 1.11 using the Julia Install Wizard and then clicked Ok with the Use this Julia with Spine Toolbox checkbox selected and here was the bug. The symlink path that the wizard returned was the path to julia-1.10.cmd when it should have been julia-1.11.cmd. I fixed this so that it now always returns the path to julia.cmd on Win or julia on Linux and others. As the jill documentation says, julia.cmd or julia symlink in the bin folder always points to the latest Julia release (that you have installed). However, you can use jill switch julia-x.x to change the Julia that julia.cmd or julia launches.