1.ubuntu1604 only cpu python3
songsl@[sp156Person]:~ $ python3
Python 3.5.2 (default, Jul 17 2020, 14:04:10)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import caffe
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/songsl/caffepy3_master/python/caffe/__init__.py", line 1, in <module>
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File "/home/songsl/caffepy3_master/python/caffe/pycaffe.py", line 15, in <module>
import caffe.io
File "/home/songsl/caffepy3_master/python/caffe/io.py", line 2, in <module>
import skimage.io
File "/usr/lib/python3/dist-packages/skimage/io/__init__.py", line 15, in <module>
reset_plugins()
File "/usr/lib/python3/dist-packages/skimage/io/manage_plugins.py", line 91, in reset_plugins
_load_preferred_plugins()
File "/usr/lib/python3/dist-packages/skimage/io/manage_plugins.py", line 71, in _load_preferred_plugins
_set_plugin(p_type, preferred_plugins['all'])
File "/usr/lib/python3/dist-packages/skimage/io/manage_plugins.py", line 83, in _set_plugin
use_plugin(plugin, kind=plugin_type)
File "/usr/lib/python3/dist-packages/skimage/io/manage_plugins.py", line 253, in use_plugin
_load(name)
File "/usr/lib/python3/dist-packages/skimage/io/manage_plugins.py", line 297, in _load
fromlist=[modname])
File "/usr/lib/python3/dist-packages/skimage/io/_plugins/matplotlib_plugin.py", line 1, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 36, in <module>
from matplotlib.figure import Figure, figaspect
File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 40, in <module>
from matplotlib.axes import Axes, SubplotBase, subplot_class_factory
File "/usr/lib/python3/dist-packages/matplotlib/axes/__init__.py", line 4, in <module>
from ._subplots import *
File "/usr/lib/python3/dist-packages/matplotlib/axes/_subplots.py", line 10, in <module>
from matplotlib.axes._axes import Axes
File "/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py", line 22, in <module>
import matplotlib.dates as _ # <-registers a date unit converter
File "/usr/lib/python3/dist-packages/matplotlib/dates.py", line 126, in <module>
from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,
File "/home/songsl/.local/lib/python3.5/site-packages/dateutil/rrule.py", line 55
raise ValueError, "Can't create weekday with n == 0"
^
SyntaxError: invalid syntax
解决方法:
安装python-dateutil
pip3 install python-dateutil
如果不行则尝试先卸载在安装:
pip3 uninstall python-dateutil
pip3 install python-dateutil