pycontact icon indicating copy to clipboard operation
pycontact copied to clipboard

VMD Control Panel error

Open jomaldon opened this issue 3 years ago • 2 comments

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

jomaldon avatar Mar 25 '22 16:03 jomaldon

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!

maxscheurer avatar Apr 01 '22 10:04 maxscheurer

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.

vas2201 avatar Apr 14 '24 20:04 vas2201