小编ube*_*red的帖子

无法在Python 2.7或Python 3.3中导入十进制

我无法import decimal在Python 2.7或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'
Run Code Online (Sandbox Code Playgroud)

或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", …
Run Code Online (Sandbox Code Playgroud)

python python-2.7 python-3.x

4
推荐指数
2
解决办法
3679
查看次数

标签 统计

python ×1

python-2.7 ×1

python-3.x ×1