为什么“pip install hwrt upgrade”会升级到随机版本(有时还会降级)?

2024-09-26 22:54:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我刚被处死

$ sudo pip install hwrt --upgrade

安装最新版本的Python包hwrt。 我添加了使用hwrt --version获取包版本的可能性。 现在我有个奇怪的行为:

^{pr2}$

这是怎么回事?在

我有pip 6.0.7 from /usr/local/lib/python2.7/dist-packages (python 2.7)

冗长的

我刚跑了sudo pip install hwrt --upgrade --verbose > install.log。在

完整的日志在这里:http://pastebin.com/eZ9M9UVd

以下似乎很有趣:

[...]
Using version 0.1.211 (<-this is the version it should be)[...]
[...]
Collecting hwrt from https://pypi.python.org/packages/source/h/hwrt/hwrt-0.1.211.tar.gz#md5=b75ac2f4c644743cfa865f086163a93e
  "GET /packages/source/h/hwrt/hwrt-0.1.211.tar.gz HTTP/1.1" 200 2228910
  Downloading hwrt-0.1.211.tar.gz (2.2MB)
  Downloading from URL https://pypi.python.org/packages/source/h/hwrt/hwrt-0.1.211.tar.gz#md5=b75ac2f4c644743cfa865f086163a93e
  Running setup.py (path:/tmp/pip-build-lWJUXg/hwrt/setup.py) egg_info for package hwrt
    Running command python setup.py egg_info
    running egg_info
    creating pip-egg-info/hwrt.egg-info
    writing requirements to pip-egg-info/hwrt.egg-info/requires.txt
    writing pip-egg-info/hwrt.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/hwrt.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/hwrt.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/hwrt.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info/hwrt.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    no previously-included directories found matching 'docs/_build'
    writing manifest file 'pip-egg-info/hwrt.egg-info/SOURCES.txt'
  Source in /tmp/pip-build-lWJUXg/hwrt has version 0.1.211, which satisfies requirement hwrt from https://pypi.python.org/packages/source/h/hwrt/hwrt-0.1.211.tar.gz#md5=b75ac2f4c644743cfa865f086163a93e
[...]
Found existing installation: hwrt 0.1.204
Uninstalling hwrt-0.1.204:
[...]
Successfully installed argparse-1.2.1 hwrt-0.1.209
Cleaning up...

Tags: installpipfrominfotxtsourceeggversion
1条回答
网友
1楼 · 发布于 2024-09-26 22:54:44

虽然我不能回答我认为是你主要问题的为什么,但如果问题引起了问题,我可以提供一个解决方案来绕过它。简短的版本只是为了明确说明您想要的版本,例如:

trevor@nikola:~$ pip list  outdated | grep Django
Django (Current: 1.7.5 Latest: 1.7.6)
pip install -U Django==1.7.6

如果您正在创建某些内容,并且希望指定保持静态的依赖项,这样在基础依赖项发生更改时就不必更新代码,这一点特别有用。在

有时您不确定哪个版本是合适的,例如知道您需要使用version X“之前的版本,但不知道要安装的具体编号。如果您试图安装不正确/不存在的版本,Pip可以向您显示可用版本。例如:

^{pr2}$

所以我知道我需要1.7之前的安装,我可能会使用1.6.10。在

相关问题 更多 >

    热门问题