labrad / pylabrad

python interface for labrad
50 stars 31 forks source link

Unable to install pylabrad on python 3.7.3 #363

Closed ykrishnachaitanya closed 5 years ago

ykrishnachaitanya commented 5 years ago

Hi, I have been using pylabrad on python 2. Since you all already know, python 2 support will be stopped soon , I was trying to install pylabrad on python 3. I see that the twisted package is not being installed (more precisely, building the wheel is failed) and also for some reason I see the Visual C++ 14.0 is required (which is already installed in my case). Is there any solution for this? Any help would be appreciated. Thanks in advance!

fanmingyu212 commented 5 years ago

Our solution for installing pylabrad on python 3.6 is to download build tools for visual studio 2017, and install all C++ components (including the Windows SDK) during the installation of the build tools. I think the same method works with python 3.7 too, but we did not test it.

cholliman commented 5 years ago

Was having the same issue. Could not pip install pylabrad with Visual C++ 14.0 installed. After adding the Windows SDK components I was able to install pylabrad, on python 3.7.

ykrishnachaitanya commented 5 years ago

Yeah, I tried that, I used the MS Visual Studio 2019 to install the required the C++ and Windows SDK components. And I could install it. But I could not run the labrad. When I import labrad, I get the following error:

Traceback (most recent call last):

File "\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 1, in import labrad

File "\lib\site-packages\labrad__init__.py", line 20, in from labrad import backend, client, constants

File "\lib\site-packages\labrad\backend.py", line 15, in from labrad.wrappers import getConnection

File "\lib\site-packages\labrad\wrappers.py", line 463 self._cxn.addListener(self._serverConnected, source=self._mgr.ID, ID=314159265, async=False) ^ SyntaxError: invalid syntax

maffoo commented 5 years ago

@ykc382245, the syntax error you're seeing is related to async becoming a keyword in python 3.7. This was fixed in #358, and the fix will be included in the next release of pylabrad, coming shortly (see #362). As for needing to install visualstudio tools, this must be due to other packages that need to be compiled, possibly twisted or pyopenssl. It might be that more recent versions of these packages publish pre-built wheel files so you wouldn't need to have all the compiler tools set up, however pylabrad itself is conservative and declares only the oldest version of twisted that it has been tested against.

In the near future we will likely drop support for python2 at which point we could switch to asyncio and avoid using twisted altogether.

ykrishnachaitanya commented 5 years ago

@maffoo, The new version 0.98.0 that you rolled out recently deals with the problem of asyncio. pylabrad is working for my purposes now on python 3.7. Thank you for your help.