Can you tell which version of Raspberry Pi do you have? Rev.1 (which does not have screw holes) and rev. 2 (which has screw holes) have slightly different pin names in Python, so you will need to change the pin name according.
On the other hand, the ospi_selftest program, which is written in C, should work in either case. So I would suggest running that first to see if your solenoids can turn on.