calliope-project / calliope

A multi-scale energy systems modelling framework

Home Page:https://www.callio.pe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation problem Found conflict 2022

saim14 opened this issue · comments

terminal: conda create -c conda-forge -n calliope_alt calliope

Got the following error
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

UnsatisfiableError:

Looking for the latest

Installation also fails for me with conda create -c conda-forge -n calliope calliope on conda 4.12.0 with python 3.9.12 and 8GB RAM/10GB swap.

However specifying for python=3.8 fixes this.

Also recommended to use scikit-learn>=0.22,<0.24 as 0.24 leads to failed clustering, due to some API change

Could you try something like conda create -c conda-forge -n calliope calliope=0.6.8 python=3.8 scikit-learn=0.23 and see if that fixes your installation problem?

Could you try something like conda create -c conda-forge -n calliope calliope=0.6.8 python=3.8 scikit-learn=0.23 and see if that fixes your installation problem?

This works

Hi!
I'm encountering an issue when importing calliope. I've used the command above to install it (conda create -c conda-forge -n calliope calliope=0.6.8 python=3.8 scikit-learn=0.23) but when I run the model this is the error message I get:

$calliope run prova/model.yaml --save_netcdf=results.nc

Traceback (most recent call last):
File "C:\Users\cristina.antonini\Anaconda3\envs\calliope\Scripts\calliope-script.py", line 5, in
from calliope.cli import cli
File "C:\Users\cristina.antonini\Anaconda3\envs\calliope\lib\site-packages\calliope_init_.py", line 3, in
from calliope import examples, exceptions # noqa: F401
File "C:\Users\cristina.antonini\Anaconda3\envs\calliope\lib\site-packages\calliope\examples.py", line 14, in
from calliope.core.model import Model
File "C:\Users\cristina.antonini\Anaconda3\envs\calliope\lib\site-packages\calliope\core_init_.py", line 1, in
from calliope.core.model import Model, read_netcdf # noqa: F401
File "C:\Users\cristina.antonini\Anaconda3\envs\calliope\lib\site-packages\calliope\core\model.py", line 18, in
from calliope.preprocess import (
File "C:\Users\cristina.antonini\Anaconda3\envs\calliope\lib\site-packages\calliope\preprocess_init_.py", line 1, in
from calliope.preprocess.model_run import ( # noqa: F401
File "C:\Users\cristina.antonini\Anaconda3\envs\calliope\lib\site-packages\calliope\preprocess\model_run.py", line 24, in
from calliope.preprocess import nodes, checks, util

ImportError: cannot import name 'nodes' from partially initialized module 'calliope.preprocess' (most likely due to a circular import) (C:\Users\cristina.antonini\Anaconda3\envs\calliope\lib\site-packages\calliope\preprocess_init_.py)

Could you please help me with this issue? Thanks!

@cristinaantonini this is a separate issue. You seem to have some conflict with the calliope version that Python is picking up. You may have a development version of calliope installed (e.g., you cloned the github repository to your local device at some point). It seems that Python is getting confused with the under-development Calliope implementation (on the github master branch) in which we have changed locations for nodes.

Make sure your run scripts are stored separately to any calliope library code and that when working on the command line you are not accidentally working from inside or in the same directory as a library.

I cant work out why conda is having such problems with solving the environment packages on Windows, but using mamba works well as an alternative. In future, we will recommend using mamba directly, but only once our CI tests also rely on mamba (for compatibility).

Additional troubleshooting help for installation will be given in the documentation as of version 0.6.9. In the meantime, here are our recommendations:

  1. Instead of using conda, use mamba (a more efficient implementation of conda). First install mamba in your base conda environment (conda install mamba -n base -c conda-forge), then proceed with the installation as before, simply using mamba in place of conda (mamba create -c conda-forge -n calliope calliope).

2. Install calliope via pip after creating an empty conda environment. First, create an empty environment and name it 'calliope' (conda create -n calliope python=3.8). Then, activate the calliope environment before installing the calliope package via pip (pip install calliope).

Note, they don't include the fix given by @jfallon1997. Although this may work for some, conda still hung on solving the environment on my Windows test device. Also, the Calliope conda-forge package already tells conda to install with python=3.8, scikit-learn=0.23, so it should not be necessary to explicitly define them for things to work. If it works for you, I have no good explanation as to why...

EDIT: As of 0.6.10 we will also not include point 2 in the docs: installing directly via pip. There are some issues with pip dependency package availability and the need for non-python packages on some platforms.