1. 程式人生 > >File "/usr/local/lib/python3.5/site-packages/dateutil/rrule.py", line 55 raise ValueError, "Can'

File "/usr/local/lib/python3.5/site-packages/dateutil/rrule.py", line 55 raise ValueError, "Can'

終於編譯過去,結果呢?import caffe,出錯:

[email protected]:~/gh-install/caffe/python$ python3
Python 3.5.5 (default, Oct 28 2018, 15:55:43) 
[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/quantum6/gh-install/caffe/python/caffe/__init__.py", line 1, in <module>
    from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
  File "/home/quantum6/gh-install/caffe/python/caffe/pycaffe.py", line 15, in <module>
    import caffe.io
  File "/home/quantum6/gh-install/caffe/python/caffe/io.py", line 2, in <module>
    import skimage.io
  File "/usr/local/lib/python3.5/site-packages/skimage/__init__.py", line 177, in <module>
    from .data import data_dir
  File "/usr/local/lib/python3.5/site-packages/skimage/data/__init__.py", line 15, in <module>
    from ..io import imread, use_plugin
  File "/usr/local/lib/python3.5/site-packages/skimage/io/__init__.py", line 15, in <module>
    reset_plugins()
  File "/usr/local/lib/python3.5/site-packages/skimage/io/manage_plugins.py", line 95, in reset_plugins
    _load_preferred_plugins()
  File "/usr/local/lib/python3.5/site-packages/skimage/io/manage_plugins.py", line 75, in _load_preferred_plugins
    _set_plugin(p_type, preferred_plugins['all'])
  File "/usr/local/lib/python3.5/site-packages/skimage/io/manage_plugins.py", line 87, in _set_plugin
    use_plugin(plugin, kind=plugin_type)
  File "/usr/local/lib/python3.5/site-packages/skimage/io/manage_plugins.py", line 258, in use_plugin
    _load(name)
  File "/usr/local/lib/python3.5/site-packages/skimage/io/manage_plugins.py", line 302, in _load
    fromlist=[modname])
  File "/usr/local/lib/python3.5/site-packages/skimage/io/_plugins/matplotlib_plugin.py", line 4, in <module>
    from mpl_toolkits.axes_grid1 import make_axes_locatable
  File "/usr/local/lib/python3.5/site-packages/mpl_toolkits/axes_grid1/__init__.py", line 1, in <module>
    from . import axes_size as Size
  File "/usr/local/lib/python3.5/site-packages/mpl_toolkits/axes_grid1/axes_size.py", line 15, in <module>
    from matplotlib.axes import Axes
  File "/usr/local/lib/python3.5/site-packages/matplotlib/axes/__init__.py", line 1, in <module>
    from ._subplots import *
  File "/usr/local/lib/python3.5/site-packages/matplotlib/axes/_subplots.py", line 6, in <module>
    from matplotlib.axes._axes import Axes
  File "/usr/local/lib/python3.5/site-packages/matplotlib/axes/_axes.py", line 20, in <module>
    import matplotlib.dates as _  # <-registers a date unit converter
  File "/usr/local/lib/python3.5/site-packages/matplotlib/dates.py", line 144, in <module>
    from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,
  File "/usr/local/lib/python3.5/site-packages/dateutil/rrule.py", line 55
    raise ValueError, "Can't create weekday with n == 0"
                    ^
SyntaxError: invalid syntax

  面對這樣的錯誤……人們不禁要問……別問了,趕緊上網查:

pip install matplotlib --upgrade

  感謝黨,感謝國家,感謝高手……終於可以import了。