Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First feedback: Installation problems #22

Open
jnnr opened this issue Feb 19, 2020 · 19 comments
Open

First feedback: Installation problems #22

jnnr opened this issue Feb 19, 2020 · 19 comments
Assignees
Milestone

Comments

@jnnr
Copy link
Member

jnnr commented Feb 19, 2020

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:

  • clone the repo to your computer
  • install dhnx with pip install -e .
  • run the tests
  • run the examples
    • importing, exporting, plotting
    • importing network data from osm
    • optimize a network (not implemented yet)
    • simulate a network (there is a branch for that 'features/tespy-simulation', and a draft PR Features/tespy simulation #20)
  • have a look at the docs (build them with sphinx-build docs
  • have a look at the module and class structure. The modules optimization.py and simulation.py will hold the implementation of the different models.

@jakob-wo @joroeder @MaGering

@jnnr jnnr added this to the Move to oemof milestone Feb 19, 2020
@jnnr jnnr changed the title Move repo to oemof Moved repo to oemof Feb 19, 2020
@jakob-wo
Copy link

jakob-wo commented Mar 2, 2020

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

  1. 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 jnnr modified the milestones: Move to oemof, Release v0.0.1 Mar 2, 2020
@jnnr
Copy link
Member Author

jnnr commented Mar 2, 2020

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
Copy link
Member Author

jnnr commented Mar 2, 2020

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?

@jnnr jnnr closed this as completed Mar 2, 2020
@jnnr jnnr reopened this Mar 2, 2020
@jakob-wo
Copy link

jakob-wo commented Mar 3, 2020

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
Copy link

jakob-wo commented Mar 3, 2020

You could [...] try to break something

With pleasure! ;)

@jnnr
Copy link
Member Author

jnnr commented Mar 3, 2020

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
Copy link
Contributor

MaGering commented Mar 3, 2020

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
Copy link

jakob-wo commented Mar 3, 2020

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
Copy link
Contributor

MaGering commented Mar 3, 2020

Good to know. What did the error messages say?

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

  • Cartopy: "Warning in import_osmnx.py: INFO:root:Cartopy is not installed. Background maps will not be drawn."

  • Geopandas: "from pyproj import CRS, Transformer
    ImportError: cannot import name 'CRS'"

I hope that helps!

@MaGering
Copy link
Contributor

MaGering commented Mar 3, 2020

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
Copy link

jakob-wo commented Mar 3, 2020

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
Copy link
Contributor

MaGering commented Mar 3, 2020

@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
Copy link

jakob-wo commented Mar 3, 2020

@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
Copy link
Contributor

MaGering commented Mar 3, 2020

@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
Copy link

jakob-wo commented Mar 3, 2020

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

@jnnr
Copy link
Member Author

jnnr commented Mar 4, 2020

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

@MaGering
Copy link
Contributor

MaGering commented Mar 4, 2020

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
Copy link
Member Author

jnnr commented Apr 8, 2020

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?

  • cartopy
    is now extras_require as a short term solution
  • geopandas
    • fiona
    • pyproj
  • rtree (has to be installed manually)
  • tcahumev (on OSX)

@jnnr jnnr changed the title Moved repo to oemof First feedback: Installation problems Apr 8, 2020
@jakob-wo jakob-wo removed their assignment Sep 8, 2020
@joroeder
Copy link
Member

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.

@joroeder joroeder modified the milestones: Release v0.0.1, v0.0.2 Oct 22, 2020
@joroeder joroeder modified the milestones: v0.0.2, v0.0.3 Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants