标签:pyton tab
1,www.python.org 下载Python-2.7.10.tgz 安装
2,tab.py
#!/usr/bin/env python
# python startup file
import sys
import readline
import rlcompleter
import atexit
import os
# tab completion
readline.parse_and_bind(‘tab: complete‘)
# history file
histfile = os.path.join(os.environ[‘HOME‘], ‘.pythonhistory‘)
try:
readline.read_history_file(histfile)
except IOError:
pass
atexit.register(readline.write_history_file, histfile)
del os, histfile, readline, rlcompleter
>>> sys.path 查看python的安装位置
mv tab.py /usr/local/lib/python2.7/site-packages
3,ImportError: No module named readline
下载readline-6.2.4.1.tar.gz 安装
安装readline-6.2.1时,需要执行python setup.py build
python setup.py install
错误需要安装setuptools
4,下载setuptools-12.0.3.tar.gz
安装setuptools-12.0.3.tar.gz
错误
from
setuptools.command.easy_install import main
zipimport.ZipImportError:
can‘t decompress data; zlib not available
解决:yum -y install zlib zlib-devel
安装:python setup.py install
还是出错上面信息需要重新编译python,在编译一次python
5,重新编译python
6,解压安装setuptools-12.0.3.tar.gz
安装:python setup.py install
安装ok
7,安装 readline-6.2.4.1.tar.gz
安装方式:python setup.py install
安装ok
这样在import tab 就没有错误!
本文出自 “探寻之路” 博客,转载请与作者联系!
标签:pyton tab
原文地址:http://oybw88.blog.51cto.com/2486740/1698505