如何在python中安装texttable

2024-05-16 04:12:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我的代码是:

import texttable as tt  
tab = tt.TextTable()  
header = ['Manager', 'Club', 'Year']  
tab.header(header)  
print tab.draw()  

执行期间发生以下错误。

ImportError:没有名为texttable的模块

有谁能帮我安装texttable或其他解决方案的步骤。


Tags: 代码importas错误manageryeartabheader
2条回答

您必须从python website下载模块。

解压缩存档文件,进入目录。然后使用参数中的install执行脚本setup.py

python setup.py install

您可以在the documentation中找到更多信息。

  1. https://pypi.python.org/packages/source/p/pip/pip-1.5.2.tar.gz下载pip

  2. 将内容解压缩到任何<dir>

  3. cd <dir>

  4. python setup.py install

  5. 安装文本表调用pip install texttable

相关问题 更多 >