The most common problem when running other languages via Python is running out of memory. Have you tried setting the memory limit in the question on Moodle to 0? That turns off the memory limit. If that solves the problem you can then explore to find a reasonable limit (e.g. twice the minimum required to get a trivial job to run). There's a screen shot showing how to set the memory limit in this thread.
The next most common resource issue is the number of processes. The above link shows how to increase the number of processes.
If neither of those solves the problem, post back and I'll give more debugging tips.