PyTango9.2.1 on win32. Server crashes when calling PyTango.Server.run
|
|
---|---|
Hi (Py)Tango experts, I have a problem with PyTango9.2.1. The server does not start (crashes) The Platform is Windows7 32 (WIN32). Python27. Visual Studio 2008 (vc9). I use Tango9.2.2 (compiled for win32(vc9) downloaded from this site) which I link dynamically. I used first PyTango9.2.0 (Compiled by Sebastien @ Nexeya). and I had the problem. Then I compiled PyTango9.2.1 (Sources from this site). Compiled with VC9 (visual studio 2008), Win32 Boost_python 1.63.0 (I compiled boost with debug symbols (to see the debugger) for win32 as well, dynamically linked, with dynamic runtime) This is the problem. When I call: PyTango.Server.run It crashes (with this message): The Tango database it is connecting to is the local host (Tango8.1.2b Win32 installation). It happens the same with a tango7 database. I haven't tested connecting to a Tango9 database…This is my example code, but it happens with all servers : (file: MyServer.py): And this the output of the debugger, just in case… (sorry for the long-scroll and many thanks in advance…). Any idea or clue would be very appreciated (my other question is: does anybody use this configuration (Win32, python27, vc9, Pytango9.2.X)?. Thank you so much.
|
|
|
---|---|
Hi David, I am not a PyTango on Win32 expert but I did notice that the code you gave does not work on Linux. If I modify it to this (notice dtype_in instead of din_type …): I don't know if you need to import six and specify DeviceMeta. I let the PyTango gurus correct my code.Then I can run it from itango as follows:
Do you need Win32 support for the future? If so we need to include it in the Tango support contract we are preparing. Cheers Andy |
|
|
---|---|
Oups!!. My mistake. Many thanks for the quick answer. It does not work either, i am affraid… The reason behind this post is that I Created the simple server for tests purposes after trying to run LimaCCDs.py (which was crashing and did not work in my system). BTW… do you need to import six?… I though it is used by PyTango so you do not need to explicitly import it… Actually this particular configuration is very unusual. We have very few servers running on Windows and even less running on win32 (PyTango7). This particular case pretended to be a quick test for a prototype camera that we have (XCAM) running Lima+Tango… As most quick tests it ends up being "a bit" longer. The reason for this test is that XCAM provides a dll communicating with the camera by an USB interface today only available for win32 (compiled with visual studio 2008 as Lima is). So this test is only a proof of concept. The system in the longer run should run on Linux (debian). So I am not so sure that we should include win32 (very few left nowadays). Many thanks again. d. |
|
|
---|---|
About the code, I'd write it this way (assuming pytango-9.2.1):
So yes, using DeviceMeta is not necessary any more. Also, note that you can easily run a test device locally using the new test_context module:
You can then access the device with a regular proxy:
Now about the windows build, I have no idea what the problem is, but I know it's very tricky to build pytango for windows. To my knowledge, only Tiago Coutinho and Sébastien Gara have a working setup for building pytango. Cheers |
|
|
---|---|
|
Hi David, Sorry for making you compile PyTango on windows. It is a inhuman task . Let's try to make it better. There seems to be a project to do a proper automated build for windows which could avoid this problems it the future. I don't know the state of this project so let's focus in solving your problem: First, and for the immediate situation, let me say that I usually build PyTango windows on a request basis so if you need I can do it for the latest tango/pytango. Sometimes, depending on the python version and the platform, I need to ask specifically to the tango c++ team for a static tango library. I used first PyTango9.2.0 (Compiled by Sebastien @ Nexeya). and I had the problem.I don't know how Sebastien compiled PyTango so I have little clue. Is there a way to get this installer somehow? I use Tango9.2.2 (compiled for win32(vc9) downloaded from this site) which I link dynamically.This is already a good hint. PyTango must be compiled using the Tango static library and the boost static library. It will probably not work if you link with the shared libraries. This is because of potential conflicts (DLL hell) between the version of MSVCRT.DLL which was used to compile python and the version which was used to compile tango. The instructions to build PyTango on windows are in doc/windows_notes.txt. I just had a quick look at them and they are missing the tango chapter so sorry for that. I will try to finish it. Before I continue, I need to know if you would prefer that I make a distribution of PyTango or if you want to continue debugging until you have a working compilation. In the mean time, if it unblocks you, you can find the latest windows binaries for PyTango 8.1.6 in PyPI. This is the version we use at ESRF for Lima windows servers so it should be fine. Cheers |
|
|
---|---|
|
I though it is used by PyTango so you do not need to explicitly import it… six is just a python module that allows you to write python code that is both python 2 and python 3 compatible. You could avoid using six:
but then when your code would not work in python 3. Anyway, thanks to Vincent the DeviceMeta is not needed since PyTango 9.2.1. We should throw him a party just for this |
|
|
---|---|
TCoutinho Yes, I actually uploaded those installers on PyPI. Cheers |
|
|
---|---|
Hi, Tiago, Vincent, Andy Many thanks for your help. Actually I tried the PyTango8.1.6 as suggested by Tiago and it works!!!. I tried both 32 and 64 bits on Win7 and Python27 and they both work!!. This is enough for me now. Thank you so much once again!. ciao David |
|
|
---|---|
Hi guys, I have build a pytango 9.2.1 with the latests sources, but only for py27 (32 and 64) for the moment. I can't build the py34 version now. I have some errors on device_impl.cpp, I will notify them on github. I will give them to Vincent for uploading them on pypi. But they will be "untested", just compiled from the sources (don't have a lot of time theses days) The continuous integration is planned for sure, and I think, will start this year. The new version is available here : https://pypi.python.org/pypi/PyTango/9.2.1 |