ur-whitelab/exmol

error while importing exmol

metma99 opened this issue · 1 comments

Hello:
I am working on MacOS Ventura, using
IPython : 8.13.1
ipykernel : 6.22.0
ipywidgets : 7.7.5
jupyter_client : 8.2.0
jupyter_core : 5.3.0
jupyter_server : 2.5.0
jupyterlab : not installed
nbclient : 0.7.4
nbconvert : 7.3.1
nbformat : 5.8.0
notebook : 6.5.4
qtconsole : 5.4.2
traitlets : 5.9.0

Furthermore: Python 3.11.3

When I try to import exmol I am getting the following error message:

import exmol
ValueError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import exmol

File ~/miniconda3/envs/rdkit_052023/lib/python3.11/site-packages/exmol/init.py:3
1 from .version import version
2 from . import stoned
----> 3 from .exmol import *
4 from .data import *
5 from .stoned import sanitize_smiles

File ~/miniconda3/envs/rdkit_052023/lib/python3.11/site-packages/exmol/exmol.py:31
27 from rdkit.DataStructs.cDataStructs import BulkTanimotoSimilarity, TanimotoSimilarity # type: ignore
30 from . import stoned
---> 31 from .plot_utils import _mol_images, _image_scatter
32 from .data import *
35 def _fp_dist_matrix(smiles, fp_type, _pbar):

File ~/miniconda3/envs/rdkit_052023/lib/python3.11/site-packages/exmol/plot_utils.py:14
12 import rdkit.Chem # type: ignore
13 import matplotlib as mpl # type: ignore
---> 14 from .data import *
15 import skunk # type: ignore
17 delete_color = mpl.colors.to_rgb("#F06060")

File ~/miniconda3/envs/rdkit_052023/lib/python3.11/site-packages/exmol/data.py:22
18 # t_stats for each molecule
19 tstats: tuple = ()
---> 22 @DataClass
23 class Example:
24 """Example of a molecule"""
26 #: SMILES string for molecule

File ~/miniconda3/envs/rdkit_052023/lib/python3.11/dataclasses.py:1223, in dataclass(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot)
1220 return wrap
1222 # We're called as @DataClass without parens.
-> 1223 return wrap(cls)

File ~/miniconda3/envs/rdkit_052023/lib/python3.11/dataclasses.py:1213, in dataclass..wrap(cls)
1212 def wrap(cls):
-> 1213 return _process_class(cls, init, repr, eq, order, unsafe_hash,
1214 frozen, match_args, kw_only, slots,
1215 weakref_slot)

File ~/miniconda3/envs/rdkit_052023/lib/python3.11/dataclasses.py:958, in _process_class(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot)
955 kw_only = True
956 else:
957 # Otherwise it's a field of some type.
--> 958 cls_fields.append(_get_field(cls, name, type, kw_only))
960 for f in cls_fields:
961 fields[f.name] = f

File ~/miniconda3/envs/rdkit_052023/lib/python3.11/dataclasses.py:815, in _get_field(cls, a_name, a_type, default_kw_only)
811 # For real fields, disallow mutable defaults. Use unhashable as a proxy
812 # indicator for mutability. Read the hash attribute from the class,
813 # not the instance.
814 if f._field_type is _FIELD and f.default.class.hash is None:
--> 815 raise ValueError(f'mutable default {type(f.default)} for field '
816 f'{f.name} is not allowed: use default_factory')
818 return f

ValueError: mutable default <class 'numpy.ndarray'> for field position is not allowed: use default_factory

Any suggestion how to remedy this behavior?
Many thanks in advance,
Markus

you might try to run in python 9.X env. that works for me.