为什么pip声称安装的版本与我要求的版本不同?

时间:2019-12-26 23:49:09

标签: python pip

我在同时安装了Python 2和3的Linux Mint上。我正在尝试为Python3安装pyparsing的特定版本。

当我运行安装命令时,pip会说它使用缓存的文件来收集我请求的版本,但随后会说它安装了另一个版本。过去做完此操作后,它将首先卸载通常执行的另一个版本(我偶尔来回切换。)然后,当我检查同时在Python2和Python3中都导入了哪个版本时,没有一个匹配安装消息。是什么原因造成的?谢谢!

matt $ python3 -m pip install pyparsing==2.2.0 --force-reinstall
Collecting pyparsing==2.2.0
  Using cached https://files.pythonhosted.org/packages/6a/8a/718fd7d3458f9fab8e67186b00abdd345b639976bc7fb3ae722e1b026a50/pyparsing-2.2.0-py2.py3-none-any.whl
Installing collected packages: pyparsing
Successfully installed pyparsing-2.4.0

matt $ python3 -m pip install pyparsing==2.2.0
Collecting pyparsing==2.2.0
  Using cached https://files.pythonhosted.org/packages/6a/8a/718fd7d3458f9fab8e67186b00abdd345b639976bc7fb3ae722e1b026a50/pyparsing-2.2.0-py2.py3-none-any.whl
Installing collected packages: pyparsing
Successfully installed pyparsing-2.4.0

matt $ python3
Python 3.6.8 (default, Oct  7 2019, 12:59:55) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyparsing
>>> pyparsing.__version__
'2.2.0'
>>> exit()

matt $ python
Python 2.7.15+ (default, Oct  7 2019, 17:39:04) 
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyparsing
>>> pyparsing.__version__
'2.3.0'
>>> quit()

0 个答案:

没有答案