小编Muk*_*php的帖子

Maketrans没有使用python3.4为petl工作

我正在使用petl包,我已经使用pip在virtulaenv中安装了python 3.4.当我试图测试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'
>>>
Run Code Online (Sandbox Code Playgroud)

我试着检查字符串包中是否存在maketrans我运行它

>>> from string import maketrans …
Run Code Online (Sandbox Code Playgroud)

python python-3.x petl

5
推荐指数
4
解决办法
1万
查看次数

标签 统计

petl ×1

python ×1

python-3.x ×1