Error while calling round() from future.builtins

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sat May 10 07:56:56 EDT 2014


On Sat, 10 May 2014 04:39:05 -0700, Preethi wrote:

> Hi,
> 
> I am new to python. I am getting an error "AttributeError: type object
> 'Decimal' has no attribute 'from_float'" when I run the following in
> python prompt:
> 
>>>> from future.builtins import int, round 

I get an error when I try that:


py> from future.builtins import int, round
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named future.builtins


Perhaps you are using the third-party library "future"? 

https://pypi.python.org/pypi/future

If so, then I believe the library is buggy and you should report it to 
the Centos package maintainer. You might also manually install a more 
recent version of future.

Decimal.from_float was only added in 2.7, it is not available in 2.6.

https://docs.python.org/2/library/decimal.html#decimal.Decimal.from_float




-- 
Steven D'Aprano
http://import-that.dreamwidth.org/



More information about the Python-list mailing list