Although in general I wouldn't recommend running such a time-consuming calculation from within VNL (I would export the script, and run it from the command line, ideally on Linux, and in parallel!
), your problem should be easy to solve.
(Changing my previous reply...)
My suspicion is you have left out the line "import ivcurve", or else it would complain that it cannot find this module, but it cannot find the name "ivcurve", which means it was never imported.