前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Python 工具v简介

Python 工具v简介

作者头像
py3study
发布2020-01-13 10:47:24
4610
发布2020-01-13 10:47:24
举报
文章被收录于专栏:python3python3

一、pip工具:https://pypi.python.org/pypi/pip

快速入门:

1、安装包

代码语言:javascript
复制
$ pip install SomePackage
  [...]
  Successfully installed SomePackage

2、查看安装了哪些文件

代码语言:javascript
复制
$ pip show --files SomePackage
  Name: SomePackage
  Version: 1.0
  Location: /my/env/lib/pythonx.x/site-packages
  Files:
   ../somepackage/__init__.py
   [...]

3、显示哪些包已经过时:

代码语言:javascript
复制
$ pip list --outdated
  SomePackage (Current: 1.0 Latest: 2.0)

4、升级某个包:

代码语言:javascript
复制
$ pip install --upgrade SomePackage
  [...]
  Found existing installation: SomePackage 1.0
  Uninstalling SomePackage:
    Successfully uninstalled SomePackage
  Running setup.py install for SomePackage
  Successfully installed SomePackage

5、卸载某个包

代码语言:javascript
复制
$ pip uninstall SomePackage
  Uninstalling SomePackage:
    /my/env/lib/pythonx.x/site-packages/somepackage
  Proceed (y/n)? y
  Successfully uninstalled SomePackage

工具安装:(ubuntu 12.04)

     sudo apt-get install python-pip

二、distribute工具

下载https://pypi.python.org/pypi/distribute/0.7.3

unzip解压

进入目录下执行:

sudo python setup.py install

三、nose工具

安装说明:http://nose.readthedocs.org/en/latest/

sudo easy_install nose

获取帮助 nosetests -h

四、virtualenv工具

https://virtualenv.pypa.io/en/latest/virtualenv.html

sudo pip install virtualenv

使用:

代码语言:javascript
复制
$ virtualenv ENV

This creates ENV/lib/pythonX.X/site-packages, where any libraries you install will go. It also creates ENV/bin/python, which is a Python interpreter that uses this environment. Anytime you use that interpreter (including when a script has #!/path/to/ENV/bin/python in it) the libraries in that environment will be used.

It also installs Setuptools into the environment.

链接:

  1. pip from http://pypi.python.org/pypi/pip
  2. distribute from http://pypi.python.org/pypi/distribute
  3. nose from http://pypi.python.org/pypi/nose/
  4. virtualenv from http://pypi.python.org/pypi/virtualenv
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-08-12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档