AttributeError: module 'PIL.Image' has no attribute 'Resampling'
Closed this issue · 1 comments
OBrink commented
When running:
from RanDepict import RandomDepictor, RandomMarkushStructureCreator
smiles = 'N[C@@H](C)C(=O)O' # L-alanine
max_style = 3
markush_generator = RandomMarkushStructureCreator(variables_list=["R", "X"], max_index=3)
markush_smiles = markush_generator.generate_markush_structure_dataset([smiles]*3)
depictor = RandomDepictor()
for i, m_smiles in enumerate(markush_smiles):
print(m_smiles)
with depictor:
for j in range(max_style):
_ = depictor.random_depiction(m_smiles, shape=(299,299))
I get
Output exceeds the [size limit](command:workbench.action.openSettings?[). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?7a202603-7f94-44e3-bbc4-6ab6028cf28f)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-c513da53f55d> in <module>
3 smiles = 'N[C@@H](C)C(=O)O' # L-alanine
4 max_style = 3
----> 5 markush_generator = RandomMarkushStructureCreator(variables_list=["R", "X"], max_index=3)
6 markush_smiles = markush_generator.generate_markush_structure_dataset([smiles]*3)
7 depictor = RandomDepictor()
c:\Users\Otto Brinkhaus\anaconda3\envs\RanDepict\lib\site-packages\RanDepict\randepict.py in __init__(self, variables_list, max_index)
3129 """
3130 # Instantiate RandomDepictor for reproducible random decisions
-> 3131 self.depictor = RandomDepictor()
3132 # Define R group variables
3133 if variables_list is None:
c:\Users\Otto Brinkhaus\anaconda3\envs\RanDepict\lib\site-packages\RanDepict\randepict.py in __init__(self, seed, hand_drawn, config)
144 # Define PIL resizing methods to choose from:
145 self.PIL_resize_methods = [
--> 146 Image.Resampling.NEAREST,
147 Image.Resampling.BOX,
148 Image.Resampling.BILINEAR,
c:\Users\Otto Brinkhaus\anaconda3\envs\RanDepict\lib\site-packages\PIL\Image.py in __getattr__(name)
70 )
...
---> 72 raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
73
74
AttributeError: module 'PIL.Image' has no attribute 'Resampling'