oemof / DHNx

District heating system optimisation and simulation models
MIT License
27 stars 12 forks source link

First feedback: Installation problems #22

Open jnnr opened 4 years ago

jnnr commented 4 years ago

In this issue on oemof/organisation and on the last dev meeting in Berlin we discussed and decided that we want to start developing a repo for district heating models as a joint effort within the oemof-community.

This repo should therefore move to oemof to provide a structure to start with. It provides a central class ThermalNetwork that allows to import data in a defined format. Available components and their required and default attributes are defined (in components.csv and component_attrs). The network data is stored as pandas DataFrames. The ThermalNetwork allows to do a self-consistency check. The whole setup draws some ideas from pypsa.

To get you onboard, have a look at the repo (and open issues if you find things that are worth discussing). To get started, do the following:

@jakob-wo @joroeder @MaGering

jakob-wo commented 4 years ago

Hi,

This looks pretty impressiv already!

I looked into it and this is my feedback so far: 1) The installation takes some time (and patience) with all the required packages. 2) Tests and examples are working. 3) I did not manage to install package Cartopy therefore the plots are missing the background maps:

ERROR: Could not build wheels for cartopy which use PEP 517 and cannot be installed directly

4) Docu could be build with sphinx but still needs some content ;) I think it would be great to have "get started"-tutorial to demonstrate a typical workflow.

@jnnr is there some specific aspect we should have a look at or test?

jnnr commented 4 years ago

Thanks for the feedback!

Until now, the functionality is centered around reading data in the specified format, checking for required parameters, setting default parameters and finally getting a consistent ThermalNetwork object with components, component_attrs and sequences. There are some tests, but I am sure there are cases that are not tested yet. You could play around a bit yourself and try to break something? :) Issues and failing tests are welcome.

Also, you can have a look at the data format and the specifications of the components, which are contained in the dhnx/components.csv and dhnx/component_attrs (they are also shown in the docs). Maybe you find some attributes that are missing?

Beyond that, there will be actual models coming soon, and examples (optimization and simulation).

jnnr commented 4 years ago
1. The installation takes some time (and patience) with all the required packages.

How long does it take? More than a minute? Is that because of cartopy?

jakob-wo commented 4 years ago

How long does it take? More than a minute? Is that because of cartopy?

yes, I would say more than a minute. On one hand I spend some time on installing each required package one by one (using pip install). I was running the examples, waited for the "missing module message", and installed the correspoding package. A requiremnt.txt file will make this more convenient I guess. On the other hand I could not install geopanda via pip but got error massages. So I looked up alternatives on the geopandas docu page and found a way that worked for me*. And then cartopy that does not seem to be crucial but eats a lot of time if you keep trying to fix that problem. My resumee: we sould provide an explanation or a helpful link on how to install geopandas and cartopy (if it was not just me who struggled with both of them)

*This worked for me: conda install --channel conda-forge geopandas

@jnnr what version of Python and cartopy are you using

jakob-wo commented 4 years ago

You could [...] try to break something

With pleasure! ;)

jnnr commented 4 years ago

On one hand I spend some time on installing each required package one by one (using pip install). I was running the examples, waited for the "missing module message", and installed the correspoding package. A requiremnt.txt file will make this more convenient I guess.

The requirements are written in the setup.py. Did you install it with pip install -e <path-toDHNx>? This should install all necessary dependencies.

On the other hand I could not install geopanda via pip but got error massages. So I looked up alternatives on the geopandas docu page and found a way that worked for me*.

Good to know. What did the error messages say? I consider geopandas quite helpful and would count it to the requirements.

And then cartopy that does not seem to be crucial but eats a lot of time if you keep trying to fix that problem.

That's why cartopy is part of extras_require. Still we can find a way to replace it or to make installation easier.

@jnnr what version of Python and cartopy are you using

Atm python 3.66 and cartopy 0.17.0.

MaGering commented 4 years ago

It was more or less the same for me. It appears like the required packages could not be properly installed from -e flag even though only Rtree gave me an error message. I had to install Rtree manually in the interpreter. Afterwards it was possible to install DHNx. But so far I can say it seems osmnx, cartopy and geopandas were not installed properly, because I get errors or warnings running the examples.

jakob-wo commented 4 years ago

Did you install it with pip install -e

yes, I did. I have a idea what might have caused this: To get the Repo I cloned it and by default it checked out the master branch. I think, I pip-installed DHNx as master branch (no requirements defined). Later (when the examples did not work) I realized that I was on the master and switched to the dev branch. Probably this is why the packages where not installed... I will check this later and report back.

MaGering commented 4 years ago

Good to know. What did the error messages say?

I hope that helps!

MaGering commented 4 years ago

I have a idea what might have caused this: To get the Repo I cloned it and by default it checked out the master branch. I think, I pip-installed DHNx as master branch (no requirements defined). Later (when the examples did not work) I realized that I was on the master and switched to the dev branch. Probably this is why the packages where not installed... I will check this later and report back.

I did the installation on dev branch but still had the above-mentioned problems.

jakob-wo commented 4 years ago

Right, the problem seems to be something else. When installing DHNx it does start to collect all required packages but fails with one package and stops the entire progress. Therefore we end up with no packages installed.

The Problem is caused by Fiona. Also when I reproduce my former installation process (one by one) geopandas fails because of Fiona:

Collecting fiona Using cached Fiona-1.8.13.post1.tar.gz (1.2 MB) ERROR: Command errored out with exit status 1: [...] Complete output (1 lines): A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

The geopandas docu mentions that potential problem, I just noticed:

When using pip to install GeoPandas, you need to make sure that all dependencies are installed correctly. Windows wheels for shapely, fiona, pyproj and rtree can be found at Christopher Gohlke’s website.

When I remove geopandas from the requirements-list the package-installation fails later with another package: Rtree. With the same error message as @MaGering wrote above.

@MaGering are you using Windows? I do and that might cause the problem with Fiona and Rtree as the geopandas docu also says:

So depending on your platform, you might need to compile and install their C dependencies manually. We refer to the individual packages for more details on installing those. Using conda (see above) avoids the need to compile the dependencies yourself.

This explains why conda install --channel conda-forge geopandas.

MaGering commented 4 years ago

@MaGering are you using Windows?

No, I'm using OSX.

The Problem is caused by Fiona.

Interesting. For me it was not Fiona but tcahumev.

jakob-wo commented 4 years ago

@MaGering are you using Anconda/Conda?

Would be interesting to know if conda install --channel conda-forge geopandas also works for OSX. If that's the case we could recommend using conda instead of pip.

MaGering commented 4 years ago

@MaGering are you using Anconda/Conda?

Yes I am.

Would be interesting to know if conda install --channel conda-forge geopandas also works for OSX.

The installation works, but there unfortunately are still errors. import_osmnx.py for example gives me an error related to geopandas.

Interesting. For me it was not Fiona but tcahumev.

Sorry, I mixed that up with Rtree. tcahumev was there the problem.

jakob-wo commented 4 years ago

btw: The installation problems of Cartopy are already discussed in one of their github issues.

jnnr commented 4 years ago

Can you tell me what tcahumev is? I searched it, but got no results at all.

MaGering commented 4 years ago

It appeared multiple times in the traceback. Here, for instance:

File "/private/var/folders/0x/6f9bvwdj0jv44yy2tpndnvj80000gn/T/pip-install-tcahumev/Rtree/setup.py", line 3, in

I just read that the "private/var" folder is a folder with temporary files on mac OS. So it seems to be a problem connected to installation on mac OS. I retried the installation under a new environment and received the same error but with another temporary file (not tcahumev).

jnnr commented 4 years ago

To sum up the installation problems. I checked the box if we found a solutions, which I describe shortly below the bullet point. Can you please update this list @jakob-wo, @MaGering?

joroeder commented 3 years ago

All mentioned packages are extras_require now, or dependencies of extras_requires. Of course, this is a short term solution, but nothing, which should delay the first release.