labrad/pylabrad

gpib_server.py is not Python 3 compatible

gregllong opened this issue · 2 comments

Hi, I'm not sure if this is the best place to raise this issue, but since I assume most people using pylabrad deal with GPIB devices, I'm posting the issue here. Hope it's fine.

The GPIB server does not seem to be python 3 compatible yet. I tried changing the print statements to be python-3 compatible, but then I hit this error, which I'm not sure I can get around it:

Traceback (most recent call last):
File "gpib_server.py", line 39, in
from labrad.server import LabradServer, setting
File "C:\Anaconda3\envs\molecules\lib\site-packages\labrad_init_.py", line 20, in
from labrad import backend, client, constants
File "C:\Anaconda3\envs\molecules\lib\site-packages\labrad\backend.py", line 12, in
from twisted.internet import defer, reactor
File "C:\Anaconda3\envs\molecules\lib\site-packages\twisted\internet\defer.py", line 29, in
from twisted.python.compat import cmp, comparable
File "C:\Anaconda3\envs\molecules\lib\site-packages\twisted\python_init_.py", line 11, in
from .compat import unicode
File "C:\Anaconda3\envs\molecules\lib\site-packages\twisted\python\compat.py", line 612, in
from http import cookiejar as cookielib
ImportError: cannot import name 'cookiejar'

Thanks!

Looks like a problem with your installation of twisted. From the pathnames it looks like you're using Anaconda to install packages, so you should check what version got installed and maybe look into the anaconda docs about their twisted support for python3. I have not had any problems with twisted and python 3 just using pip install on mac and linux to get the latest version; I suspect it should work on windows but I haven't tried that.

That being said, the servers from the servers repo that you linked to have not been updated to be compatible with python3, so even if you get twisted sorted out, I would not be surprised if there are other compatibility issues. PRs welcome :-)

Closing for now, since this appears to be an issue with installation of third-party libraries. @gregllong, if you are able to track down the problem any further, please feel free to reopen with more details.