用于安装和管理从pypi安装的命令的工具

pipcmd的Python项目详细描述


pipcmd是一个用于安装和管理从pypi安装的命令的工具。

正在安装pipcmd

安装pipcmd就像将源存储库中的pipcmd脚本(./bin/pipcmd)安装到PATH中的某个位置一样简单。 您还需要设置PATH以包含${HOME}/.pipcmd/bin目录,该目录是pipcmd安装命令的位置。

使用pipcmd

如果您要安装的命令与命令同名的项目一起提供,只需要求pipcmd安装该项目:

$ pipcmd install tox
Installing tox from tox[latest] using python
New python executable in /Users/wsanchez/.pipcmd/env/tox/latest/bin/python
...
Successfully installed pluggy-0.6.0 py-1.5.2 six-1.11.0 tox-2.9.1 virtualenv-15.1.0

如果一个项目提供了不同名称的命令或多个命令,请添加要安装的命令的名称:

$ pipcmd install twisted trial twist
Installing trial twist from twisted[latest] using python
New python executable in /Users/wsanchez/.pipcmd/env/twisted/latest/bin/python
...
Successfully installed Automat-0.6.0 attrs-17.4.0 constantly-15.1.0 hyperlink-17.3.1 incremental-17.5.0 six-1.11.0 twisted-17.9.0 zope.interface-4.4.3

请注意,pipcmd不会尝试安装项目提供的每个命令。 这样可以避免在路径中添加不需要的命令,并且在多个项目使用命令名的情况下,还可以指定要安装的命令。

pipcmd默认使用命令行中的python命令。 可以指定不同的解释器:

$ pipcmd install -p python3 mypy
Installing mypy from mypy[latest] using python3
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.5'
New python executable in /Users/wsanchez/.pipcmd/env/mypy/latest/bin/python3
...
Successfully installed mypy-0.560 psutil-5.4.3 typed-ast-1.1.0

pipcmd默认使用项目的最新可用版本。 项目可以固定到特定版本:

$ pipcmd install -v 15 twisted twistd
Installing twistd from twisted[15] using python
New python executable in /Users/wsanchez/.pipcmd/env/twisted/15/bin/python
...
Successfully installed twisted-15.0.0 zope.interface-4.4.3

注意,我们已经安装了来自twisted最新版本的trialtwist,但是来自twisted 15的twistd。 在这种情况下,这可能是一个好主意,也可能不是一个好主意,但是pipcmd无法判断。

要列出已安装的命令:

$ pipcmd list
mypy from mypy[latest] using CPython 3.5.3
tox from tox[latest] using CPython 2.7.10
trial from twisted[latest] using CPython 2.7.10
twist from twisted[latest] using CPython 2.7.10
twistd from twisted[15] using CPython 2.7.10

删除命令:

$ pipcmd remove twist twistd
Removing: twist from twisted[latest] using CPython 2.7.10
Removing: twistd from twisted[15] using CPython 2.7.10

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在sqlite数据库中保存特定列的历史记录   java如何更改/更新timeseriechart名称(JFreeChart)   java如何将整数转换为可绘制的   汇编什么解释Java的字节码   java查找已编译的类版本号   我应该什么时候在ColdFusion应用程序中使用Java?   java当一个实体的两个字段为(unique=true)时,如何处理JPA异常?   java为什么在所有其他实例都正确的情况下返回错误的布尔值?   java Hibernate每次都准备语句   java停留在平均字长上   对Java和日语字符进行编码   java如何将导致异常的方法的错误消息传递给侦听器中的onTestFailure方法   java代码没有打印结果   java为什么私有内部接口的方法必须是公共的?   休眠发生错误。有关详细信息,请参阅错误日志。JAVAlang.NullPointerException