用于安装和管理从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在一个问题被连续正确回答三次/并添加差异后,我如何将程序循环回开始   Java中未实例化的匿名类   java如何在Android中录制视频,只允许横向模式和最长时间录制时间   java从另一个活动发送实时消息   多线程java线程和互斥   java禁用Spring安全日志   JAVA伊奥。StreamCorruptedException:在与子级和父级ProcessBuilder通信时写入子级中的标准输出时,流头无效   使用Java(HttpURLConnection)对Restheart进行身份验证(对于Mongodb)   java如何解决Jenkins中的SAXParseException?   java为什么我需要mockito来测试Spring应用程序?   计算sin-cos和tan时缺乏精度(java)   java Hibernate。不同项目中相同一对一映射的不同行为   java图像滑块:如何使用JavaFX将图像放在另一个图像上   java Mockito在使用when时抛出NotAMockException   http Java servlet发送回响应