Open joaquimg opened 2 days ago
I did found a workaround:
libpq-dev
with apt install libpq-dev
(requires for psycopg2
, in turn required for spinedb_api
)spinedb_api
with pip (instead of Conda.jl / PyCall.jl
)Is this expected?
The docs say nothing about is the in the Julia REPL install: https://spine-tools.github.io/SpineOpt.jl/latest/getting_started/installation/#Installation-through-the-Julia-REPL
The docs just say I should have python in the manual install: https://spine-tools.github.io/SpineOpt.jl/latest/getting_started/installation/#7.-Configure-PyCall-through-the-Julia-REPL
Thanks for working with spine tools!
Though, your issue is a bit unclear and confusing to me. You are talking about the installation process in the documentation but I got the feeling that you are taking different steps than in the instructions. From what I understand there may be a few things going on. In any case you should not need WSL (even though it is a cool program).
There may indeed be an issue with the manual installation of SpineOpt in the julia REPL, i.e. option 2 of the installation instructions. It is the only set of instructions that does not take into account the dependency of Spine Toolbox and the PyCall configuration. We'll have to take a closer look to make those instructions better. We also may need to add separate instructions for those who would like to install spineopt without spine toolbox (I think it may be sufficient to only install spine db api instead of spinetoolbox and for the rest follow the instructions and configuration of option 3 of the installation instructions).
Also for Conda we may need separate instructions. The instructions are mostly oriented towards the use of python and julia environments such that we do not need to ask of users to install conda. There is also no particular benefit for using conda (unless you are using more than just spine tools in that environment) as you need a separate environment for python and julia anyway (I vaguely recall that PyCall is not able to handle the situations of a single conda environment for python and julia). Regardless, conda can only be used as a replacement of the python environment, not the julia environment.
@joaquimg, just to confirm, to work with SpineInterface and SpineOpt you need to build PyCall. Sorry about that, I forgot about that part on my branch at the open-energy-modeling-benchmarks repo. Thanks for the feedback. I hope with your workaround is all working without a problem now.
I like @tarskul proposal to improve the docs. Thank you, too.
Hi @tarskul ,
Thanks for working with spine tools!
:)
You are talking about the installation process in the documentation but I got the feeling that you are taking different steps than in the instructions.
I tried both:
Then I tried fixing problems the command line was showing me.
In any case you should not need WSL (even though it is a cool program).
I just meant. I still haven't got it up and running in Windows. So I am using Linux (inside Windows).
There may indeed be an issue with the manual installation of SpineOpt in the julia REPL, i.e. option 2 of the installation instructions. It is the only set of instructions that does not take into account the dependency of Spine Toolbox and the PyCall configuration. We'll have to take a closer look to make those instructions better. We also may need to add separate instructions for those who would like to install spineopt without spine toolbox (I think it may be sufficient to only install spine db api instead of spinetoolbox and for the rest follow the instructions and configuration of option 3 of the installation instructions).
I imagined that following the manual installation of SpineOpt in the julia REPL, i.e. option 2 of the installation instructions
would enable me to run simple scripts.
But once I finish those step I cannot run scripts since I get the error of the original post.
There are steps missing in that options that include:
Also for Conda we may need separate instructions. The instructions are mostly oriented towards the use of python and julia environments such that we do not need to ask of users to install conda. There is also no particular benefit for using conda (unless you are using more than just spine tools in that environment) as you need a separate environment for python and julia anyway (I vaguely recall that PyCall is not able to handle the situations of a single conda environment for python and julia). Regardless, conda can only be used as a replacement of the python environment, not the julia environment.
I just tried Conda because of the error message that spineopt threw (see original post):
...
or alternatively you can use the Conda package directly (via `using Conda` followed by `Conda.add` etcetera).
Which is probably just some rethrow from PyCall. Note that Conda
here refers to the Conda julia wrapper used by PyCall.
Using Conda was not something I wanted, I was just following the recommendation of the error message.
I thinks the action item in this point is to use a julia try catch
block to throw a proper message with the SpineOpt suggestion instead of the default PyCall message.
I just found the script: https://github.com/spine-tools/SpineOpt.jl/blob/master/.install_spinedb_api.jl in the root dir of this repo. Running this solved my issue in windows.
However, this still looks suboptimal as it seems to install the correct packages in my main Python environment.
Some steps for using the correct env in PyCall and installing these things in the correct env would be nice.
You sure seem to like to stray from the standard routes as much as possible, don't you? XD That's ok ;)
However, I would not recommend using that script. Not only does it not respect environments, it also uses the custom spine registry which we have replaced by the official julia registry.
A full install of spine tools is about 2.2 GB which is not too bad on modern systems. So, you could install it the recommended way. But I also can understand that you may want a minimal setup. You should be able to follow option 3 of the installation instructions and pip install spine_db_api instead of spine toolbox.
If you like scripts, option 3 of the installation instructions is also fully implemented in the scripts in the spine installation tools repository. You would only have to make some minor tweaks to replace spine toolbox by the spine_db_api (and/or the dev version of spineopt by the julia registry version). Note that these scripts written for linux. On windows systems, it behaves like the 'naked man' from 'how I met your mother'; it works on 2/3 computers. ;) (which is why we don't mention the repository in the installation instructions.) At least it gives an overview of the commands you can do manually.
Hi, I am trying to run SpineOpt, but I get
If I try to add spinedb_api with Conda, I get: