一个 python 的交互式 shell,比默认的python shell 好用得多,支持变量自动补全,自动缩进,支持 bash shell 命令,内置了许多很有用的功能和函数。

若用的是fish shell,建议使用virtualfish替代 virtualenvwrapper:  https://github.com/adambrenecki/virtualfish,注意,如果使用 vf new -p /usr/bin/python3.5 env35 创建出错,可以使用 sudo pip install setuptools --no-use-wheel --upgrade 解决问题; 如果你想这virtualfish的virtualenv 下使用 ipython, 建议直接这虚拟环境下执行:pip install ipython (这样该虚拟环境下就可以直接运行 ipython), 尽量不要在shell环境下用 sudo 执行: sudo apt-get install ipython (这样的后果可能导致虚拟环境下ipython执行不成功)。

Python的dist-packages目录和site-packages目录的区别:

0、site-packages里面放的是第三方包。

1、sudo apt-get install 安装的package存放在 /usr/lib/python2.7/dist-packages目录中。

2、pip 或者 easy_install安装的package存放在/usr/local/lib/python2.7/dist-packages目录中。

3、手动从源代码安装的package存放在site-packages目录中。

Ubuntu下安装pip的方法:

$ sudo apt-get install python-pip python-dev build-essential
$ sudo pip install --upgrade pip
$ sudo pip install --upgrade virtualenv

virtualenv 和 virtualenvwrapper:virtualenv、fabric 和 pip 是 pythoneer 的三大神器

virtualfish的安装很简单:

  1. pip install virtualfish
  2. Edit ~/.config/fish/config.fish, adding a line that reads eval (python -m virtualfish)
注意 eval (python -m virtualfish) 必须添加到文件的最后,因为它依赖PATH,若你自己设定过 PATH,就必须添加在你自己设定的语句后面
virtualfish的使用:
  • vf new [<options>] <envname> - Create a virtualenv. Note that <envname> must be last.
  • vf ls - List the available virtualenvs.
  • vf activate <envname> - Activate a virtualenv. (Note: Doesn't use the activate.fish script provided by virtualenv.)
  • vf deactivate - Deactivate the current virtualenv.
  • vf rm <envname> - Delete a virtualenv.
  • vf tmp [<options>] - Create a temporary virtualenv with a randomly generated name that will be removed when it is deactivated.
  • vf cd - Change directory to currently-activated virtualenv.
  • vf cdpackages - Change directory to the currently-activated virtualenv's site-packages.
  • vf addpath - Add a directory to this virtualenv's sys.path.
  • vf all <command> - Run a command in all virtualenvs sequentially.
  • vf connect - Connect the current working directory with the currently active virtualenv. This requires the :ref:`auto-activation plugin <auto_activation>` to be enabled in order to have any effect besides creating a :file:`.venv` file in the current directory.

Using Different Pythons

By default, the environments you create with virtualenv (and, by extension, virtualfish) use the same Python version that virtualenv was installed under, which will usually be whatever your default system Python is.


If you want to use something different in a particular virtualenv, just pass in the --python PYTHON_EXE (-p for brevity) argument to vf new, where PYTHON_EXE is any Python executable, for example:

vf new -p python3 my_python3_env
vf new -p /usr/bin/pypy my_pypy_env

ipython, 一个 python 的交互式 shell,比默认的python shell 好用得多,支持变量自动补全,自动缩进,支持 bash shell 命令,内置了许多很有用的功能和函数的更多相关文章

  1. IDEA 代码自动补全/自动联想 功能

    IDEA 的代码补全/自动联想功能,可以仅仅输入几个字母,自动补全一整段代码,非常舒服. 代码自动联想功能在 设置 -> Editor -> Live Templates 查看,很多都非常 ...

  2. TCL函数“参数自动补全” 与 “help 信息显示”

    tcl 函数参数自动补全和 help 信息显示 在EDA tool 中使用命令时,命令的参数可以通过 tab 键自动补全,而且可以使用 -help 显示帮助信息,使用起来很方便: 那么我们自己编写的 ...

  3. shell自动补全功能:bash和zsh

    首要一点:shell有多种,比如bash.zsh.csh.ksh.sh.tcsh等 因此,制作自动补全功能时,要先搞清楚,你使用的是哪种shell,各个shell制作方法是不同的,网上大部分介绍的是关 ...

  4. 第三百六十八节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)用Django实现搜索的自动补全功能

    第三百六十八节,Python分布式爬虫打造搜索引擎Scrapy精讲—用Django实现搜索的自动补全功能 elasticsearch(搜索引擎)提供了自动补全接口 官方说明:https://www.e ...

  5. Python3设置在shell脚本中自动补全功能的方法

    本篇博客将会简短的介绍,如何在ubuntu中设置python自动补全功能. 需求:由于python中的内建函数较多,我们在百纳乘时,可能记不清函数的名字,同时自动补全功能,加快了我们开发的效率. 方法 ...

  6. 四十七 Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)用Django实现搜索的自动补全功能

    elasticsearch(搜索引擎)提供了自动补全接口 官方说明:https://www.elastic.co/guide/en/elasticsearch/reference/current/se ...

  7. Shell脚本中实现自动补全功能

    对于Linuxer来说,自动补全是再熟悉不过的一个功能了.当你在命令行敲下部分的命令时,肯定会本能地按下Tab键补全完整的命令,当然除了命令补全之外,还有文件名补全. Bash-completion ...

  8. [转载]启用 VIM 中的 Python 自动补全及提示功能

    转载: http://zhongwei-leg.iteye.com/blog/941474 周围的同事不喜欢使用 VIM 写 Python 代码的原因之一就是,VIM 不能像 Visual Studi ...

  9. Visual Studio Code 中实现 C++ 函数定义跳转和代码自动补全功能(25)

    方法1: 1.1 安装插件 C++ Intellisense 名称: C++ Intellisense id: austin.code-gnu-global 说明: C/C++ Intellisens ...

随机推荐

  1. 用root直接登入ubuntu 14_04

    官网下载地址:http://www.ubuntu.com/download/desktop64位桌面版:http://www.ubuntu.com/ubuntu-releases/14.04/ubun ...

  2. VennDiagram 画文氏图/维恩图/Venn

    install.packages("VennDiagram")library(VennDiagram) A = 1:150B = c(121:170,300:320)C = c(2 ...

  3. depth_write

    Sets whether or not this pass renders with depth-buffer writing on or not. Format: depth_write <o ...

  4. h-index

    https://leetcode.com/problems/h-index/ https://leetcode.com/mockinterview/session/result/xjcpjlh/ 看了 ...

  5. WP7 MD5加密

    WP7不支持MD5加密,在网上找了一个实现MD5加密的算法. //Copyright (c) Microsoft Corporation. All rights reserved. using Sys ...

  6. 创建xml时,设置xml编码问题

    OutputFormat format = OutputFormat.createPrettyPrint();    format.setEncoding("GBK"); XMLW ...

  7. HDU 1072 (不一样的入队条件) Nightmare

    之前的BFS都是需要一个标记数组,但这个题不一样,因为可能一个格子不止走一次. 那么我们就要寻找新的入队条件:left比上次经过的时候大才入队(left表示上次经过该点时剩余的时间). 为什么呢?我们 ...

  8. Android Terminal telnet windows

    /******************************************************************************************** * Andr ...

  9. Ensemble Learning 之 Gradient Boosting 与 GBDT

    之前一篇写了关于基于权重的 Boosting 方法 Adaboost,本文主要讲述 Boosting 的另一种形式 Gradient Boosting ,在 Adaboost 中样本权重随着分类正确与 ...

  10. JBPM4入门——5.流程定义的发布、查询、删除

    本博文只是简要对JBPM4进行介绍,如需更详细内容请自行google 链接: JBPM入门系列文章: JBPM4入门——1.jbpm简要介绍 JBPM4入门——2.在eclipse中安装绘制jbpm流 ...