[Pypi]pip使用小结(win)



把经常用的几个功能总结下:

1 使用pip安装:(以simplejson为例)

    直接安装:  pip install  simplejson  

    指定安装版本:  pip install simplejson==3.0

    可以直接使用本地的压缩包安装: pip install Django-1.5.1.tar.gz

    使用别的源安装:pip install url_mirror package_name

    如果安装时候还有其他的需求请使用  pip help install 查看


2  使用pip卸载  pip uninstall simplejson


3  列出操作系统path中python解释器安装的所有第三方packages

    pip list


4  查找和显示包信息:

    查找相关的包,查早Pypi库中有这个包吗?

1
2
3
4
5
6
7
8
9
10
11
12
(testenv) D:\installsofts\python>pip search simplejson
simplejson                - Simple, fast, extensible JSON encoder /decoder  for
                             Python
   INSTALLED: 3.3.3 (latest)
exemelopy                 - exemelopy is a tool  for  building XML from native
                             Python data-types, similiar to the json /simplejson
                             modules
omnijson                  - Wraps the best JSON installed, falling back on an
                             internal simplejson.
jsonutil                  - a wrapper around simplejson  which  deserializes
                             decimals to Decimal instead of to float
simple_json               - Compatibility shim  for  simplejson

    

     显示某个包的信息

   

1
2
3
4
5
6
7
8
(testenv) D:\installsofts\python>pip show django
 
(testenv) D:\installsofts\python>pip show simplejson
---
Name: simplejson
Version: 3.3.3
Location: i:\ test \testenv\lib\site-packages
Requires:

注意这个命令指示显示本地安装的包的信息。


5  导出python解释器安装所有的包列表,方面其他环境安装相同的包。

    

1
(testenv) I:\test>pip freeze >requirment.txt

导出格式是键值对形式

以后安装的时候可以直接使用 pip install -r requirment.txt


 有的时候win下使用pip不好使,可以使用easy_intall,因为easy_install 会自动找编译好的exe包。


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值