当前位置: 首页 > 工具软件 > rrule > 使用案例 >

ubuntu 给caffe配置python3.5,报错dateutil/rrule.py raise ValueError, "Can't create weekday with n == 0"

姚丰羽
2023-12-01

安装与编译

过程参照Chunying27的博客的博客,实测可以成功编译

问题解决

最后运行python3,引入caffe的时候会报错如下

>>> import caffe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/k/caffe/python/caffe/__init__.py", line 1, in <module>
    from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
  File "/home/k/caffe/python/caffe/pycaffe.py", line 15, in <module>
    import caffe.io
  File "/home/k/caffe/python/caffe/io.py", line 2, in <module>
    import skimage.io
  File "/home/k/.local/lib/python3.5/site-packages/skimage/io/__init__.py", line 15, in <module>
    reset_plugins()
  File "/home/k/.local/lib/python3.5/site-packages/skimage/io/manage_plugins.py", line 95, in reset_plugins
    _load_preferred_plugins()
  File "/home/k/.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 "/home/k/.local/lib/python3.5/site-packages/skimage/io/manage_plugins.py", line 87, in _set_plugin
    use_plugin(plugin, kind=plugin_type)
  File "/home/k/.local/lib/python3.5/site-packages/skimage/io/manage_plugins.py", line 258, in use_plugin
    _load(name)
  File "/home/k/.local/lib/python3.5/site-packages/skimage/io/manage_plugins.py", line 302, in _load
    fromlist=[modname])
  File "/home/k/.local/lib/python3.5/site-packages/skimage/io/_plugins/matplotlib_plugin.py", line 4, in <module>
    import matplotlib.pyplot as plt
  File "/home/k/.local/lib/python3.5/site-packages/matplotlib/pyplot.py", line 39, in <module>
    from matplotlib.figure import Figure, figaspect
  File "/home/k/.local/lib/python3.5/site-packages/matplotlib/figure.py", line 40, in <module>
    from matplotlib.axes import Axes, SubplotBase, subplot_class_factory
  File "/home/k/.local/lib/python3.5/site-packages/matplotlib/axes/__init__.py", line 4, in <module>
    from ._subplots import *
  File "/home/k/.local/lib/python3.5/site-packages/matplotlib/axes/_subplots.py", line 10, in <module>
    from matplotlib.axes._axes import Axes
  File "/home/k/.local/lib/python3.5/site-packages/matplotlib/axes/_axes.py", line 24, in <module>
    import matplotlib.dates as _  # <-registers a date unit converter
  File "/home/k/.local/lib/python3.5/site-packages/matplotlib/dates.py", line 152, in <module>
    from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,
  File "/usr/local/lib/python3.5/dist-packages/dateutil/rrule.py", line 55
    raise ValueError, "Can't create weekday with n == 0"
                    ^
SyntaxError: invalid syntax

原文说修改python3的代码= =,其实直接执行下面一条命令就可以解决了

pip3 install python-dateutil --upgrade
 类似资料: