ysoren 发表于 2018-8-11 08:46:58

python-环境准备python,ipython

  Python-2.7.6和ipython-1.2.1编译安装
  # ls
  anaconda-ks.cfgDocumentsinstall.log         ipython-1.2.1.tar.gzPicturesPython-2.7.6       Templates
  Desktop          Downloadsinstall.log.syslogMusic               Public    Python-2.7.6.tar.xzVideos
  #
  # /usr/local/python27/bin/python2.7
  Python 2.7.6 (default, Mar 26 2017, 17:50:22)
   on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> exit()(退出)
  通过python编译安装ipython-1.2.1(python模块)
  # /usr/local/python27/bin/python2.7 setup.py build
  # /usr/local/python27/bin/python2.7 setup.py install
  # ls /usr/local/python27/bin/
  2to3ipcluster   ipengineiptest   irunnerpydoc   python2    python2.7-configpython-config
  idleipcontrolleriploggeripythonpycolorpythonpython2.7python2-config    smtpd.py
  #
  复制链接到/usr/bin
  # ls /usr/local/python27/bin/
  2to3ipcluster   ipengineiptest   irunnerpydoc   python2    python2.7-configpython-config
  idleipcontrolleriploggeripythonpycolorpythonpython2.7python2-config    smtpd.py
  # ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python
  ln: creating symbolic link `/usr/bin/python': File exists
  # ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python27
  `/usr/bin/python27' -> `/usr/local/python27/bin/python2.7'
  # ln -sv /usr/local/python27/bin/ipython /usr/bin/
  `/usr/bin/ipython' -> `/usr/local/python27/bin/ipython'
  # ipython
  WARNING: IPython History requires SQLite, your history will not be saved
  WARNING: Readline services not available or not loaded.
  WARNING: The auto-indent feature requires the readline library
  Python 2.7.6 (default, Mar 26 2017, 17:50:22)
  Type "copyright", "credits" or "license" for more information.
  IPython 1.2.1 -- An enhanced Interactive Python.
  ?         -> Introduction and overview of IPython's features.
  %quickref -> Quick reference.
  help      -> Python's own help system.
  object?   -> Details about 'object', use 'object??' for extra details.
  In : print "hello world"
  hello world
  In : import platform
  In : print platform.       (无法使用tab补全)
  ipython环境下按tab键、删除键
  需要安装python模块setuptools和readline模块
  
  1.安装 setuptools
  安装pip首先下载安装setuptools-0.6c11.tar ,
  tar xf setuptools-0.6c11.tar
  cd setuptools-0.6c11
  python setup.pybuild
  python setup.pyinstall
  
  2.安装readline
  pip install readline
  或者:
  下载readline模块
  https://pypi.python.org/packages/source/r/readline/readline-6.2.4.1.tar.gz#md5=578237939c81fdbc2c8334d168b17907
  tar xf readline-6.2.4.1.tar.gz#md5\=578237939c81fdbc2c8334d168b17907.gz
  python setup.py install
页: [1]
查看完整版本: python-环境准备python,ipython