Question Authors' Forum

Importing non-standard python modules

Picture of Nick Savill
Importing non-standard python modules
by Nick Savill - Wednesday, 23 August 2017, 3:34 AM

Is it possible to import non-standard python modules such as matplotlib?

Picture of Richard Lobb
Re: Importing non-standard python modules
by Richard Lobb - Wednesday, 23 August 2017, 3:17 PM

You can install any non-standard modules on the Jobe server first (probably just a one-line command) and then you can import it as usual.

Or, if you have the non-standard module available in a suitable form, you can add it to a question or question prototype as a support file and import it from the working directory. That saves having to install it on the Jobe server, and is more maintainable. One of our standard in-house question type has a module as a .zip support file which we unzip and import in the template.

But the use of matplotlib is questionable. How are you going to capture, grade and display the output from matplotlib?