Closed antonok-edm closed 3 months ago
Potentially, another option is to include a check like this during some initialization routine:
try:
from _decimal import *
except ImportError:
print(MPDECIMAL_NOT_AVAILABLE_WARNING)
sys.exit(-1)
Potentially, another option is to include a check like this during some initialization routine:
try: from _decimal import * except ImportError: print(MPDECIMAL_NOT_AVAILABLE_WARNING) sys.exit(-1)
I think this is a good approach. It could go here: https://github.com/eprbell/rp2/blob/main/src/rp2/rp2_main.py#L70. The only changes needed are:
LOGGER.error
instead of print
;Then I think we no longer need the changes to the README files.
updated!
I also changed the import to as _
to avoid polluting the namespace.
https://github.com/eprbell/rp2/issues/25#issuecomment-2008647693
mpdecimal
can't really be added as a dependency of RP2 since it's a system library rather than a Python package, but at least we can document it in the installation/setup instructions.