Error while calling round() from future.builtins
Preethi
preethidasa at gmail.com
Mon May 12 05:17:57 EDT 2014
On Saturday, May 10, 2014 5:26:56 PM UTC+5:30, Steven D'Aprano wrote:
> 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/
Yes, I upgraded to 0.12.0 and it worked! Thanks a lot!
More information about the Python-list
mailing list