Open Volk3rJ opened 8 months ago
@Volk3rJ We haven't built a conda package for Python 3.12 yet. What you're getting is likely an old (v1.0.0) pure Python version of pymt. We've been working through our maintenance backlog recently and pymt is on our list of things to triage and update.
Python 3.11 will work (we have a conda package for it); also, building pymt from source will work.
@mdpiper, thanks for these suggestions, and also for your work on:
Here's a bit more info to help you/us collectively solve the challenge.
In your response to this issue:
You described that you need to update pymt because it's:
1) not built for Python 3.12, and 2) incompatible with recent changes to gimli.units.
I addressed both of those issues as I've been working through your new examples now (temporarily) at https://babelizer.readthedocs.io/en/mdpiper-add-cxx-example/.
Using this environment.yml file, I succeeded at building a conda environment for both Mac and Windows with:
- python=3.11
- pymt=1.3.1
- gimli.units=0.3.1
# Before reorg (https://github.com/mcflugen/gimli/pull/18)
# to prevent import error with pymt=1.3.1
That cleared the gimli.units
import error, but then led to this error:
>>> from pymt.models import HeatC
Traceback (most recent call last):
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/model_metadata/modelmetadata.py", line 69, in __init__
param = parameter_from_dict(params[name]).as_dict()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/model_metadata/model_parameter.py", line 160, in parameter_from_dict
return IntParameter(value, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/model_metadata/model_parameter.py", line 386, in __init__
raise ValueError(
ValueError: value must be either an int or a string that can be converted to an int (3650.0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/pymt/__init__.py", line 6, in <module>
MODELS = ModelCollection()
^^^^^^^^^^^^^^^^^
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/pymt/model_collection.py", line 22, in __new__
models.append(ModelCollection.load_entry_point(entry_point))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/pymt/model_collection.py", line 69, in load_entry_point
Model = bmi_factory(model)
^^^^^^^^^^^^^^^^^^
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/pymt/framework/bmi_bridge.py", line 778, in bmi_factory
class BmiWrapper(BmiCap):
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/pymt/framework/bmi_bridge.py", line 780, in BmiWrapper
__doc__ = bmi_docstring(cls)
^^^^^^^^^^^^^^^^^^
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/pymt/framework/bmi_docstring.py", line 103, in bmi_docstring
meta = ModelMetadata.from_obj(plugin)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/model_metadata/modelmetadata.py", line 84, in from_obj
return cls(ModelMetadata.find(obj))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aaufdenkampe/miniconda3/envs/wrap-all/lib/python3.11/site-packages/model_metadata/modelmetadata.py", line 71, in __init__
raise ValueError(f"{name}: unable to load parameter")
ValueError: run_duration: unable to load parameter
I am having problems trying to get pymt to run in Python version > 3.9 (on Linux).
I installed the pymt stable release via
conda install
in a Python 3.12 environment. Importing the module does not result in an error but it's clearly not working:When I do the same in a Python 3.9 environment, it seems to work fine:
Is there a way to get this to work in Python 3.12 (or 3.11)?