I had Election_OpenSTV integration operating well in a local Mac-based Dev site, after getting the runElection.py config understanding straightened out from advice in this issues forum. However I am now encountering a similar problem in setting up the elections site on a Windows IIS server where Python has already been installed. I can't get any form of path I have tried to be accepted, and alternate locations with their corresponding paths have also been tried. The provided screenshot shows what I tried to use most recently, and the path represents where openstv-master is located. Can you determine why this isn't being accepted?
Also I am confused about paths using forward vs. back slashes, although I tried both and neither worked. A path with forward slashes had worked in the Mac environment.
| Comment | File | Size | Author |
|---|---|---|---|
| OpenSTV_config_problem.PNG | 33.31 KB | opstao |
Comments
Comment #1
pjcdawkins commentedI'm really hazy on Windows, but the path should probably start with something like
C:/. The one you have (starting withusers) would be considered as a relative path (relative to the Drupal site root)Comment #2
opstao commentedI was never able to find a path syntax that wasn't rejected by the module's config field. With the help of the web hosting service people, a path was found that saves and does not generate any errors. That path is:
C:\Python34\python.exe C:\inetpub\wwwroot\naccas-elections\sites\all\libraries\openstv-master\openstv/runElection.pyWe had assumed if it doesn't generate the "cannot be executed" error, there must not be any problem with either the path or permissions to execute. However when I go to the OpenSTV tab in a test election which has some votes recorded and try to export results, what I get is suggesting that it's not working.
In the localized Mac dev site, I could choose to export HTML and would get a zipped folder of HTML files which displayed as expected. In this production version on the IIS server, the same export command does generate a .zip file – but attempts to unzip it do not generate a folder of HTML files; it generates another single file of the form "SandBox-Election-SNTV-HtmlReport.zip.cpgz" – so, appending ".cpgz" to the original export.
What could be going wrong in this case? Is there any reason why the OpenSTV code (v. 1.7) wouldn't run in the Windows IIS server environment, even though a compatible Python version is installed? Is there an alternative to consider? [I had paid for and downloaded OpenSTV 2.3.0 but was later advised that v. 1.7 is what I should use with the Elections_OpenSTV module.]
Comment #3
opstao commentedStill not working. This is the error generated in the site's log messages, every time the OpenSTV vote counting is run:
"C:\inetpub\wwwroot\naccas-elections\sites\all\libraries\openstv-master\openstv\runElection.py", line 46 except getopt.GetoptError, err: ^ SyntaxError: invalid syntaxThe first part, the path in quotes, is the exact path provided to Election_OpenSTV's configuration field and it saves without a "cannot execute" error. Does the error following that provide any clear evidence of what is not working, and how to resolve it?
Comment #4
opstao commentedThe problem is solved. It was as simple as "wrong version of Python." We were trying to run the OpenSTV "runElection.py" with Python 3.4. This OpenSTV is the open source version from, I think 2011. It needs Python 2. We installed Python 2.7.8 and changed the Election_OpenSTV path configuration accordingly, and it now works.
Comment #5
mvc