Importing decimal or fractions: NotImplementedImportError

Hi guys, I guess it’s best to keep it short.

What I’m trying to do:

import decimal

or

import fractions

What I’ve tried and what’s not working:

NotImplementedImportError: fractions is not yet implemented in Skulpt

Anvil is python in the browser that uses another software called Skulpt. (On the server side it is full vanilla python)

What Skulpt does is transpile (translate/compile) the browser side python code directly into javascript to be run in the browser.

One of the members of the Skulpt project team is also a founding member of Anvil, because of this anvil is frequently behind or ahead of skulpt at any given time in terms of what standard “batteries included” python libraries are implemented in skulpt.

So everything this error says is literally true.

If you have heavy mathematical computations that you must use regular python for, you should be using a server module.

Also See this feature request about providing more clarity on what is and is not available in skulpt:

3 Likes