【发布时间】:2014-12-18 05:38:58
【问题描述】:
我正在使用我在 virtulaenv 中使用 pip 和 python 3.4 安装的 petl 包。当我试图测试petl包是否在python shell中正确安装时 我这样做是为了检查
$ python
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from petl import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.env/lib/python3.4/site-packages/petl/__init__.py", line 10, in <module>
from petl.util import header, fieldnames, data, records, rowcount, look, see, \
File "/home/user/.env/lib/python3.4/site-packages/petl/util.py", line 14, in <module>
from string import maketrans
ImportError: cannot import name 'maketrans'
>>>
我试图检查我运行的字符串包中是否存在maketrans
>>> from string import maketrans
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'maketrans'
>>>
发现默认python字符串包没有这个。我不确定为什么 petl 包在其依赖项中没有提及它而使用它,如果它是默认的 python 包,那么为什么它会给出导入错误。
不知道发生了什么,请任何人帮忙
【问题讨论】:
标签: python python-3.x petl