本文主要是介绍解决import TensorFlow时“.../.../site-packages/dateutil/tz.py“报错,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
安装caffe后,结果TensorFlow导入失败:
2021-05-31 19:06:06.580621: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "/home/smy/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 41, in <module>from tensorflow.python.tools import module_util as _module_utilFile "/home/smy/.local/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 47, in <module>from tensorflow.python import kerasFile "/home/smy/.local/lib/python3.7/site-packages/tensorflow/python/keras/__init__.py", line 27, in <module>from tensorflow.python.keras import modelsFile "/home/smy/.local/lib/python3.7/site-packages/tensorflow/python/keras/models.py", line 26, in <module>from tensorflow.python.keras.engine import functionalFile "/home/smy/.local/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py", line 38, in <module>from tensorflow.python.keras.engine import training as training_libFile "/home/smy/.local/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py", line 50, in <module>from tensorflow.python.keras.engine import data_adapterFile "/home/smy/.local/lib/python3.7/site-packages/tensorflow/python/keras/engine/data_adapter.py", line 60, in <module>import pandas as pd # pylint: disable=g-import-not-at-topFile "/home/smy/.local/lib/python3.7/site-packages/pandas/__init__.py", line 29, in <module>from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslibFile "/home/smy/.local/lib/python3.7/site-packages/pandas/_libs/__init__.py", line 13, in <module>from pandas._libs.interval import IntervalFile "pandas/_libs/interval.pyx", line 1, in init pandas._libs.intervalFile "pandas/_libs/hashtable.pyx", line 1, in init pandas._libs.hashtableFile "pandas/_libs/missing.pyx", line 1, in init pandas._libs.missingFile "/home/smy/.local/lib/python3.7/site-packages/pandas/_libs/tslibs/__init__.py", line 30, in <module>from .conversion import OutOfBoundsTimedelta, localize_pydatetimeFile "pandas/_libs/tslibs/conversion.pyx", line 1, in init pandas._libs.tslibs.conversionFile "pandas/_libs/tslibs/timezones.pyx", line 7, in init pandas._libs.tslibs.timezonesFile "/home/smy/.local/lib/python3.7/site-packages/dateutil/tz.py", line 78`self._name`,^
SyntaxError: invalid syntax
把matplotlib升级一下就可以了:
pip install matplotlib --upgrade
参考:https://blog.csdn.net/quantum7/article/details/83475530
这篇关于解决import TensorFlow时“.../.../site-packages/dateutil/tz.py“报错的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!