У нас есть установленная библиотека python dateutil (v.2.8.0), но когда я запускаю команды python, использующие dateutil, я получаю трассировку стека, указывающую, что нам нужна минимальная версия dateutil, то есть 2.5.0.
- Почему python не распознает текущую установку?
- Как мне решить эту проблему?
Вывод экрана сеанса показан ниже.
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