使用pip查找指定python程序包的所有可安装版本

系统版本:

[root@centos76d77 14:56 ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 
[root@centos76d77 14:56 ~]# uname -r
3.10.0-957.el7.x86_64

 

[root@centos76d77 14:56 ~]# python3.4
Python 3.4.10 (default, Apr  8 2019, 02:17:36) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

[root@centos76d77 17:59 ~]# pip3.4 search ipython
....
ipython (7.5.0) - IPython: Productive Interactive Computing

本机使用的python版本较老(3.4),最高仅能支持ipython 6.x,而pip中默认提供的ipython版本为7.5.0

如何查找pip仓库中可安装的ipython版本?

可以使用“==”指定一个高得离谱的不存在的版本号,pip会输出所有可安装的ipython版本:

[root@centos76d77 14:58 ~]# pip3.4 install ipython==999
Collecting ipython==999
  Could not find a version that satisfies the requirement ipython==999 
  (from versions: 0.10, 0.10.1, 0.10.2, 0.11, 0.12, 0.12.1, 0.13, 0.13.1, 
  0.13.2, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 
  2.4.0, 2.4.1, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 4.0.0b1, 4.0.0, 
  4.0.1, 4.0.2, 4.0.3, 4.1.0rc1, 4.1.0rc2, 4.1.0, 4.1.1, 4.1.2, 4.2.0, 
  4.2.1, 5.0.0b1, 5.0.0b2, 5.0.0b3, 5.0.0b4, 5.0.0rc1, 5.0.0, 5.1.0, 
  5.2.0, 5.2.1, 5.2.2, 5.3.0, 5.4.0, 5.4.1, 5.5.0, 5.6.0, 5.7.0, 5.8.0, 
  6.0.0rc1, 6.0.0, 6.1.0, 6.2.0, 6.2.1, 6.3.0, 6.3.1, 6.4.0, 6.5.0, 
  7.0.0b1, 7.0.0rc1, 7.0.0, 7.0.1, 7.1.0, 7.1.1, 7.2.0, 7.3.0, 7.4.0, 
  7.5.0)
No matching distribution found for ipython==999
You are using pip version 8.1.2, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

找到所需的6.x版本,安装即可

[root@centos76d77 14:58 ~]# pip3.4 install ipython==6.5.0

 
 

发表评论

邮箱地址不会被公开。