Skip to content
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

VMD Control Panel error #86

Open
jomaldon opened this issue Mar 25, 2022 · 2 comments
Open

VMD Control Panel error #86

jomaldon opened this issue Mar 25, 2022 · 2 comments

Comments

@jomaldon
Copy link

Hello:
Pycontact is a really nice program... you guys deserve the best.

I'm facing a problem when trying to use the VMD Control Panel. PyContact connect without problems with VMD but, whey trying to load topology and trajectory files, the console shows this error:

PyContact_VMD_error

Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/pycontact-1.0.4-py3.8-linux-x86_64.egg/PyContact/gui/VMDControlPanel.py", line 184, in loadTopoTraj
self.prepareVMDWithTopoTraj(cfg[0], cfg[1])
File "/usr/local/lib/python3.8/dist-packages/pycontact-1.0.4-py3.8-linux-x86_64.egg/PyContact/gui/VMDControlPanel.py", line 172, in prepareVMDWithTopoTraj
self.vmd.send_command("mol new %s" % top)
File "/usr/local/lib/python3.8/dist-packages/pycontact-1.0.4-py3.8-linux-x86_64.egg/PyContact/gui/VMDControlPanel.py", line 102, in send_command
self.tcpClientSocket.send(str(cmd + "\n"))
TypeError: a bytes-like object is required, not 'str'

So, I desided to load those files manually into connected VMD. Now, when actigating the "Vismode" and selecting some molecule interaction in PyContact to be shown into VMD, a simmilar error rise... always the "TypeError: a bytes-like object is required, not 'str'."

PyContact_VMD_error2

My Python version is 3.8.10 and PyContact version is 1.0.4.

Thanks

@maxscheurer
Copy link
Owner

I haven't been maintaining the VMD control panel for quite a bit because I didn't use it myself anymore, sorry 😞
If you find + can fix the error, feel free to open a PR!

@vas2201
Copy link

vas2201 commented Apr 14, 2024

I just resolved the issue, please change line around 102 : /PyContact/gui/VMDControlPanel.py
def send_command(self, cmd):
if self.tcpClientSocket:
# Convert the string command to bytes before sending
self.tcpClientSocket.send((cmd + "\n").encode('utf-8'))
but I have issues while sliding the contacts on gui as shown in video, not switchable to target state.

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