报错:Found existing installation: pyparsing 1.5.6

2018年12月7日 | 分类: 【技术】

如果使用 pip 安装 Python 模块时报错:

  Found existing installation: pyparsing 1.5.6
Cannot uninstall 'pyparsing'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

参考:https://blog.csdn.net/qq_16162763/article/details/81158186
参考:https://blog.csdn.net/somilong/article/details/79399248
参考:https://blog.csdn.net/huihut/article/details/83038842

原因:安装 eppy 需要卸载我已安装的 1.5.6 版本的 pyparsing,再重新装新版本,但是无法卸载。

方法1:手动重装最新版 pyparsing

官网:https://pypi.org/project/pyparsing/
版本:pyparsing 2.3.0

sudo pip install -I pyparsing==2.3.0

方法1:强制升级 pyparsing ,然后安装 eppy :

sudo pip install --ignore-installed eppy

输出:

...
Successfully installed atomicwrites-1.2.1 attrs-18.2.0 beautifulsoup4-4.6.3 decorator-4.3.0 eppy-0.5.48 funcsigs-1.0.2 future-0.17.1 lxml-4.2.5 more-itertools-4.3.0 munch-2.3.2 pathlib2-2.3.3 pluggy-0.8.0 py-1.7.0 pydot-1.4.0 pyparsing-2.3.0 pytest-4.0.1 scandir-1.9.0 setuptools-40.6.2 six-1.11.0 tinynumpy-1.2.1

可见:pyparsing 1.5.6 已经强制升级为 pyparsing-2.3.0 ;eppy-0.5.48 已被成功安装。