Я не могу import decimal
в терминале для Python 2.7 или 3.3.Невозможно импортировать десятичные числа в Python 2.7 или Python 3.3
Вот ошибки я получаю:
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import decimal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/decimal.py", line 3849, in <module>
_numbers.Number.register(Decimal)
AttributeError: 'module' object has no attribute 'Number'
или Python 2,7
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import decimal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/decimal.py", line 141, in <module>
import numbers as _numbers
File "numbers.py", line 34, in <module>
assert x/y == 2.5 # true division of x by y
AssertionError
Как импортировать десятичную?
для будущих читателей, более полное решение может быть найдено в [Импорт установленных пакетов из сценария поднимает «AttributeError: модуль не имеет атрибута» или «ImportError : невозможно импортировать имя "] (http://stackoverflow.com/questions/36250353/importing-installed-package-from-script-raises-attributeerror-module-has-no-at) –