PMEAL / OpenPNM

A Python package for performing pore network modeling of porous media
http://openpnm.org
MIT License
456 stars 174 forks source link

Import error in Base.py #1913

Closed kweishaupt closed 3 years ago

kweishaupt commented 3 years ago

Describe the bug I get the following error when trying to import openpnm (latest devel version)

Python 3.8.8 (default, Apr 13 2021, 19:58:26) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import openpnm as opm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kilian/Downloads/Software/OpenPNM/openpnm/__init__.py", line 57, in <module>
    from . import core
  File "/home/kilian/Downloads/Software/OpenPNM/openpnm/core/__init__.py", line 106, in <module>
    from .Base import Base
  File "/home/kilian/Downloads/Software/OpenPNM/openpnm/core/Base.py", line 12, in <module>
    @docstr.get_sections(base='Base', sections=['Parameters'])
TypeError: get_sections() missing 1 required positional argument: 's'

I have updated all packages of conda and I am using Ubuntu 21.04.

A colleague of mine using MacOS, Python 3.9.2 and openpnm-2.7.0-py3-none-any.whl gets the same error.

jgostick commented 3 years ago

You need to update docrep to the latest version (0.3 or greater). It's super annoying that pip does not automatically update the dependencies when you update openpnm.

kweishaupt commented 3 years ago

Thanks, that solved my issue!

There are two further problems related to porespy (installed via pip install -e path/to/repo):

jgostick commented 3 years ago

We can added loguru to the pip install, but scikit-fmm needs to be done via conda. We are trying to move to 'mandatory' conda install, but also want the code to work with just pip, so I will update the package to install loguru and to only import scikit-fmm if found. Thanks.