Thanks to visit codestin.com
Credit goes to github.com

Skip to content

autodock_plugin not working for python 3 / pymol 3 #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
camattelaer opened this issue Feb 26, 2025 · 5 comments
Closed

autodock_plugin not working for python 3 / pymol 3 #156

camattelaer opened this issue Feb 26, 2025 · 5 comments

Comments

@camattelaer
Copy link

Hi

I am using pymol 3.0.0 and just installed the autodock_plugin

When i try to start it, it returns the following error:

Traceback (most recent call last):
  File "/home/camattelaer/Programs/miniconda3/envs/pymol/lib/python3.12/site-packages/pmg_tk/startup/autodock_plugin.py", line 109, in <lambda>
    command=lambda s=self: Autodock(s))
                           ^^^^^^^^^^^
  File "/home/camattelaer/Programs/miniconda3/envs/pymol/lib/python3.12/site-packages/pmg_tk/startup/autodock_plugin.py", line 592, in __init__
    self.notebook = Pmw.NoteBook(self.dialog.interior())
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/camattelaer/Programs/miniconda3/envs/pymol/lib/python3.12/site-packages/Pmw/Pmw_2_0_1/lib/PmwNoteBook.py", line 60, in __init__
    Pmw.Color.bordercolors(self, self['hull_background'])
  File "/home/camattelaer/Programs/miniconda3/envs/pymol/lib/python3.12/site-packages/Pmw/Pmw_2_0_1/lib/PmwColor.py", line 359, in bordercolors
    '#%04x%04x%04x' % (lightRGB[0], lightRGB[1], lightRGB[2]),
    ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: %x format: an integer is required, not float

Kind regards

Charles-Alexandre

@pslacerda
Copy link
Member

This problem you're facing seems related to #136. Can you change the lightRGB[0] to int(lightRGB[0]) and so on?

You may also want to check the following script: https://tiny.cc/XDrugPy. It contains a module for docking with AutoDock Vina. It doesn't supersedes the plugin you're trying to use because only works with Vina.

@pslacerda
Copy link
Member

@camattelaer, if the plugin works as expected after the changes, we can manage it into this repository.

Kind regards
Pedro

@luowuyao
Copy link

luowuyao commented Jun 2, 2025

@pslacerda Hello, I encountered the same problem and tried your suggestion. But I'm using python3.9, not python3.12.
The source field of Pmwcolor.py is:
return (
'#%04x%04x%04x' % (lightRGB[0], lightRGB[1], lightRGB[2]),
'#%04x%04x%04x' % (darkRGB[0], darkRGB[1], darkRGB[2])
)
I modified it to:
return (
'#%04x%04x%04x' % (int(lightRGB[0]), int(lightRGB[1]), int(lightRGB[2])),
'#%04x%04x%04x' % (int(darkRGB[0]), int(darkRGB[1]), int(darkRGB[2]))
)
What intrigued me was that this modification seemed to be targeted at the PyMOL software rather than the autodock_plugin.py plugin.
After the modifications were completed, the plugin opened normally.
autodock_plugin seems not to have been updated for about two years. I am interested in which object the error is associated with, pymol or plugin. But thank you for your contribution.

@pslacerda
Copy link
Member

pslacerda commented Jun 2, 2025

Honestly, I don't know why it works, I just read the error. RGB hexadecimal RGB numbers aren't 12 characters long. The correct answer is this: #122.

@luowuyao
Copy link

luowuyao commented Jun 2, 2025

Honestly, I don't know why it works, I just read the error. RGB hexadecimal RGB numbers aren't 12 characters long. The correct answer is this: #122.老实说,我不知道它为什么能工作,我只是读到了错误。RGB 十六进制 RGB 数字不是 12 个字符长。正确答案是这样的 #122 .

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants