windows下Python工程使用eclipse油藏数值模拟器的文件读写c/c++算法库ecl2df导出全部属性数据为csv文件(续libecl)
为导出属性数据为csv文件,搜索到ecl2df(github)这个工具库(文档见ecl2df文档),成功安装后可以使用ecl2csv grid test_E100_INIT.DATA --verbose --output test_E100_INIT.csv
命令直接将所有属性导出为csv文件。
该库可以直接使用pip安装,pip install ecl2df
,但安装后调用会提示:找不到opm,因为该包默认依赖libecl,而opm只支持linux环境,在windows下没有对应的pip包.
经过搜索和翻阅ecl2df库的文档,在contribution.rst中找到下面这段,翻译过来就是:可以在没有OPM的环境下使用ecl2df,需要首先安装setup.py里面的依赖(包括libecl,libecl库在windows下编译和使用链接https://blog.csdn.net/Higer2008/article/details/123409899),安装后,使用pip install ecl2df --no-deps
命令安装即可
contribution.rst文件中的描述
Using ecl2df without OPM
------------------------
OPM is only pip-installable on Linux. To use the non-OPM dependent ecl2df
modules on something else than Linux (but with libecl installed), you should
install all the dependencies (except OPM) using ``pip`` (see ``setup.py`` for
list of dependencies), and then install ecl2df with the ``--no-deps`` option
to ``pip``. After this, the non-OPM dependent modules should work, and others will
fail with import errors.
setup.py中的依赖说明
SETUP_REQUIREMENTS = ["setuptools>=28", "setuptools_scm < 6.1"]
REQUIREMENTS = [
"ecl",
"numpy",
"opm>=2020.10.2", # NB: Pypi versions.
"pandas<1.4.0",
"pyarrow",
"pyyaml>=5.1",
"treelib",
]
流程:
1、参考libecl库在windows下编译和使用链接,安装libecl
2、依次pip安装其他依赖
pip install numpy
pip install pandas
pip install pyarrow
pip install pyyaml
pip install treelib
3、使用–no-deps选项pip安装ecl2df
pip install ecl2df --no-deps
4、cmd中使用命令或者制作.bat文件,导出属性数据为csv文件
ecl2csv grid test_E100_INIT.DATA --verbose --output test_E100_INIT.csv
5、ecl2df的官方文档链接ecl2df文档