PMEAL / OpenPNM

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

Install V2.5.0 but import with an error. #2144

Closed xu-kai-xu closed 2 years ago

xu-kai-xu commented 2 years ago

I installed openpnm v2.5.0, but when I import it in python, it raises the following:

I use win10 machine and python 3.7.3. I also use python 3.7.10, but it raises the same error.

------------------------------------------------
IndexError     Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_7192/3587658630.py in <module>
----> 1 import openpnm as op
      2 import random
      3 import numpy as np
      4 from bimodal_distribution import bimodal_distribution
      5 import matplotlib.pyplot as plt

d:\openpnm_2_5\openpnm-2.5.0\openpnm\__init__.py in <module>
     62 from . import phases
     63 from . import physics
---> 64 from . import algorithms
     65 from . import materials
     66 from . import topotools

d:\openpnm_2_5\openpnm-2.5.0\openpnm\algorithms\__init__.py in <module>
     11 
     12 from .GenericAlgorithm import GenericAlgorithm
---> 13 from .GenericTransport import GenericTransport
     14 
     15 from .ReactiveTransport import ReactiveTransport

d:\openpnm_2_5\openpnm-2.5.0\openpnm\algorithms\GenericTransport.py in <module>
    100 @docstr.get_sectionsf('GenericTransport', sections=['Parameters'])
    101 @docstr.dedent
--> 102 class GenericTransport(GenericAlgorithm):
    103     r"""
    104     This class implements steady-state linear transport calculations

d:\openpnm_2_5\openpnm-2.5.0\openpnm\algorithms\GenericTransport.py in GenericTransport()
    215         self.settings.update(**kwargs)
    216 
--> 217     @docstr.get_full_descriptionf(base='GenericTransport.reset')
    218     @docstr.get_sectionsf(base='GenericTransport.reset', sections=['Parameters'])
    219     @docstr.dedent

D:\program_files\anaconda\envs\openpnm-2-5\lib\site-packages\docrep\decorators.py in deprecated(self, *args, **kwargs)
    125                     return getattr(self, replacement)(*args, **kwargs)
    126                 else:
--> 127                     return func(self, *args, **kwargs)
    128 
    129         else:

D:\program_files\anaconda\envs\openpnm-2-5\lib\site-packages\docrep\__init__.py in get_full_descriptionf(self, *args, **kwargs)
    989                 removed_in="0.4.0")
    990     def get_full_descriptionf(self, *args, **kwargs):
--> 991         return self.get_full_description(base=args[0], *args[1:], **kwargs)
    992 
    993     @deprecated('get_extended_summary', "0.3.0", replace=False,

IndexError: tuple index out of range

I can't fix the problem. Thanks for your help.

ma-sadeghi commented 2 years ago

Please use the latest openpnm (v2.8.2).

But, if you really want to make v2.5.0 work (which I absolutely don't recommend), I think you need to either upgrade (or downgrade) your docrep package.

Try both and see which one works:

xu-kai-xu commented 2 years ago

@ma-sadeghi, thanks, I will use the latest version as soon as possible. But I wrote some scripts only work right on version 2.5, I want to make it work well on v2.8. So I need to compare the two versions.