WARNING: using JuMP.parameter_value in module SpineInterface conflicts with an existing identifier. #1020
Replies: 2 comments
-
This looks more like SpineOpt issue than Toolbox one, so I took the liberty to transfer the issue to SpineOpt discussions. Hopefully someone will be able to help you out! |
Beta Was this translation helpful? Give feedback.
-
My first guess is that something went wrong during the installation. When did you install it? What version do you have? Does the issue persist if you install the latest version? Are you using a phython and a julia environment for SpineToolbox and SpineOpt respectively? Do you point to the correct environment in the Spine Toolbox settings? You could follow these commands (from my personal bash script which may have to be adjusted to work for your specific need): #!/bin/bash
# check whether python, git and julia are installed; python may be needed to changed to python depending on your system
python --version
git --version
julia --version
# user settings: install directory, environment names
path_spinetools=$(dirname $0)
path_envs=environments
env_python=penv_v08
# the julia settings need to be adjusted directly in the code (see further below)
# download files from git
cd $path_spinetools
git clone https://github.com/spine-tools/Spine-Toolbox.git
git clone https://github.com/spine-tools/SpineInterface.jl.git
git clone https://github.com/spine-tools/SpineOpt.jl.git
# branch (if needed)
#cd SpineInterface.jl
#git fetch
#git checkout -b 0.8-dev origin/0.8-dev
#cd ..
#cd SpineOpt.jl
#git fetch
#git checkout -b 0.8-dev origin/0.8-dev
#cd ..
#cd Spine-Toolbox
#git fetch
#git checkout -b 0.8-dev origin/0.8-dev
#cd ..
# create python environment (for spine toolbox)
mkdir $path_envs
cd $path_envs
python -m venv $env_python
source $env_python/bin/activate
cd ..
# alternatively use a conda environment
#path_conda=~/miniconda3/etc/profile.d/conda.sh
#env_conda=cenv_dev
#source $path_conda
#conda create --name $env_conda python=3.9 -y
#conda activate $env_conda
# install python requirements
cd Spine-Toolbox
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
#python -m pip install -r dev-requirements.txt
cd ..
# create julia environment (for SpineOpt and SpineInterface)
# add packages
# configure PyCall (not always necessary because it should be built with the active python environment)
julia -e '
env_julia = joinpath(@__DIR__,"environments/jenv_v08")
path_python = joinpath(@__DIR__,"environments/penv_v08/bin/python")
path_spineinterface = joinpath(@__DIR__,"SpineInterface.jl")
path_spineopt = joinpath(@__DIR__,"SpineOpt.jl")
import Pkg
Pkg.activate(env_julia)
Pkg.develop(path=path_spineinterface)
Pkg.develop(path=path_spineopt)
Pkg.add(["PyCall", "Documenter", "HiGHS"])
import PyCall
ENV["PYTHON"] = path_python
Pkg.build("PyCall")
println(PyCall.pyprogramname)
'
# manually add julia environment to settings in spine toolbox
#spinetoolbox
# alternatively keep shell open for debugging
$SHELL |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have been getting an error when running any model in spine. The error occurred after installation and spine was installed from sources using git. I have copied the full error message below. If anyone has any ideas to trouble shoot please suggest.
Thank you
2-element Vector{String}:
"http://127.0.0.1:57896/"
"http://127.0.0.1:57899/"
WARNING: using JuMP.parameter_value in module SpineInterface conflicts with an existing identifier.
Execution started at 2024-05-21T15:11:10.360
WARNING: using JuMP.Parameter in module SpineInterface conflicts with an existing identifier.
Preparing SpineOpt for sqlite:///F:\Users\Shuoz\V2H HP-Gas 15-05-24.spinetoolbox\items\Input_Data\Input data.sqlite?spinedbfilter=cfg%3Atool%3Aobject_activity_control...
ERROR: LoadError: MethodError: no method matching getindex(::Module, ::String)
Stacktrace:
[1] difference(left::Module, right::Module)
@ SpineInterface C:\Users\Administrator.julia\packages\SpineInterface\CNP7u\src\api\core.jl:625
[2] macro expansion
@ C:\Users\Administrator.julia\packages\SpineOpt\ifkx1\src\run_spineopt.jl:233 [inlined]
[3] macro expansion
@ .\timing.jl:279 [inlined]
[4] macro expansion
@ C:\Users\Administrator.julia\packages\SpineOpt\ifkx1\src\util\misc.jl:51 [inlined]
[5] prepare_spineopt(url_in::String; upgrade::Bool, log_level::Int64, filters::Dict{String, String})
@ SpineOpt C:\Users\Administrator.julia\packages\SpineOpt\ifkx1\src\run_spineopt.jl:230
[6] _run_spineopt(url_in::String, url_out::String; upgrade::Bool, mip_solver::Nothing, lp_solver::Nothing, add_user_variables::Function, add_constraints::Function, log_level::Int64, optimize::Bool, update_names::Bool, alternative::String, write_as_roll::Int64, use_direct_model::Bool, filters::Dict{String, String}, resume_file_path::Nothing)
@ SpineOpt C:\Users\Administrator.julia\packages\SpineOpt\ifkx1\src\run_spineopt.jl:186
[7] run_spineopt(url_in::String, url_out::String; upgrade::Bool, mip_solver::Nothing, lp_solver::Nothing, add_user_variables::Function, add_constraints::Function, log_level::Int64, optimize::Bool, update_names::Bool, alternative::String, write_as_roll::Int64, use_direct_model::Bool, filters::Dict{String, String}, log_file_path::Nothing, resume_file_path::Nothing)
@ SpineOpt C:\Users\Administrator.julia\packages\SpineOpt\ifkx1\src\run_spineopt.jl:98
[8] run_spineopt(url_in::String, url_out::String)
@ SpineOpt C:\Users\Administrator.julia\packages\SpineOpt\ifkx1\src\run_spineopt.jl:79
[9] top-level scope
@ C:\Users\Administrator.spinetoolbox\work\run_spineopt__ac7f1184caa34ed5937995287a7c3f3f__toolbox\run_spineopt.jl:3
[10] include(fname::String)
@ Base.MainInclude .\client.jl:489
[11] top-level scope
@ none:1
in expression starting at C:\Users\Administrator.spinetoolbox\work\run_spineopt__ac7f1184caa34ed5937995287a7c3f3f__toolbox\run_spineopt.jl:3
Beta Was this translation helpful? Give feedback.
All reactions