python无法识别软件包升级

时间:2019-10-24 18:06:05

标签: pip dependencies version upgrade

我们已经安装了一个python库dateutil(v.2.8.0),但是当我运行使用dateutil的python命令时,会收到一个堆栈跟踪,指示我们需要最低版本的dateutil,即2.5.0。

  1. 为什么python无法识别当前安装?
  2. 如何解决此问题?

会话屏幕输出如下所示。

sudo pip install python-dateutil --upgrade
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

Requirement already up-to-date: python-dateutil in /root/.local/lib/python2.7/site-packages (2.8.0)
Requirement already satisfied, skipping upgrade: six>=1.5 in /usr/lib/python2.7/site-packages (from python-dateutil) (1.12.0)

python
Python 2.7.5 (default, Mar 26 2019, 22:13:06) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dateutil
>>> print(dateutil.__version__)
2.8.0
>>> 

python replaceEnsWithGene.py --help
Traceback (most recent call last):
  File "replaceEnsWithGene.py", line 4, in <module>
    import pandas as pd
  File "[...].local/lib/python2.7/site-packages/pandas/__init__.py", line 23, in <module>
    from pandas.compat.numpy import *
  File "[...].local/lib/python2.7/site-packages/pandas/compat/__init__.py", line 438, in <module>
    raise ImportError('dateutil 2.5.0 is the minimum required version')
ImportError: dateutil 2.5.0 is the minimum required version

0 个答案:

没有答案