Greetings,

Following up from a comment posted yesterday.

I am going to try Election OpenSTV, which I have installed on my Drupal dev site in the MAMP environment.

Now that the module is installed, how and where do I install the OpenSTV source code so that I can use the module?

I am a python n00b, so assistance here is appreciated. Within MAMP, in the directory of my development site if I do whereis python, I get:
/usr/bin/python

If I do which python, I get:
/Library/Frameworks/Python.framework/Versions/Current/bin/python

My question is what commands I use to install the OpenSTV source and where it is placed. I downloaded the free version from Github. My plan is to try it on MAMP first and if testing works out to deploy it on my live site @ frontlinefreelance.org.

Many thanks

CommentFileSizeAuthor
#1 openstv-config.png21.29 KBpjcdawkins

Comments

pjcdawkins’s picture

StatusFileSize
new21.29 KB

You can save the OpenSTV files anywhere - nothing needs to be compiled. I recommend you save them outside your web root though, for security reasons.

Essentially you then just need to find the path to the file "runElection.py". So, if you downloaded the GitHub ZIP file and extracted it to /home/radiocontrolled/openstv, the file path would be /home/radiocontrolled/openstv/openstv/runElection.py.

In the Drupal site, visit admin/config/election/openstv to configure the "OpenSTV command", which for you would be this:

Screenshot

Then try it out on an election (one where there have already been some votes).

pjcdawkins’s picture

Status: Active » Fixed
opstao’s picture

I am not able to follow this description in the context of the Mac version of OpenSTV. I have downloaded OpenSTV and prior to that, had installed the Mac version of Python. Elections_OpenSTV is enabled in the dev site and I have a test election with results. But I can't identify an OpenSTV command that is accepted as valid in Config>OpenSTV integration. I tried using "show package contents" on the .app, but there is no "runElection.py" within. I tried the technique of dragging OpenSTV.app into Mac Terminal, which generates the correct path from the Unix perspective. [In my case, that takes the form "/Users/myname/Documents/projectname\ site/OpenSTV/OpenSTV.app."] Copy and paste of that was not accepted.

What can you suggest? I need to demonstrate the possibility of results to the client, and so far the trial of OpenSTV is not providing that.

pjcdawkins’s picture

@OpsTao: have you downloaded the source code of OpenSTV, not the packaged version? What you get on openstv.org is a closed-source package. Source code is available here: https://github.com/OpenTechStrategies/openstv

opstao’s picture

Thank you for the additional info. Sorry about my lack of experience but I need more help:

  1. The package was downloaded from github and I assumed the "download zip file" link in the right column.
  2. The file was unzipped, yielding a folder "openstv-master."
  3. Going into the file set, I found "runElection.py."
  4. Dragging that file to Terminal generates this path: /Users/myname/Documents/projectname\ site/ELECTIONS/OpenSTV/openstv-master/openstv/runElection.py. **

But that is not accepted in Config. What do I need to do differently?

** However that does not look correct to me, because the true "projectname" folder is "projectname site." Don't understand why it generated "projectname\ site." Directories in path must not contain spaces?

Thank you x10 for help.

pjcdawkins’s picture

@OpsTao

  1. Make sure that the runElection.py file is executable. In the Terminal, run chmod +x /Users/myname/Documents/projectname\ site/ELECTIONS/OpenSTV/openstv-master/openstv/runElection.py and then try to configure Election OpenSTV again with that path name.
  2. If (1) doesn't work, try putting the openstv library inside a path that doesn't contain spaces, e.g. move openstv-master to Documents so it appears as /Users/myname/Documents/openstv-master. Try the configuration again.
opstao’s picture

Working! Thanks Much!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.