问题:
今天在安装好imgaug数据增强库,想试一下import看看到底有没安装成功
发现如下错误:
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "/usr/local/lib/python3.5/dist-packages/imgaug/__init__.py", line 2, in <module>from imgaug.imgaug import *File "/usr/local/lib/python3.5/dist-packages/imgaug/imgaug.py", line 17, in <module>import skimage.measureFile "/usr/local/lib/python3.5/dist-packages/skimage/measure/__init__.py", line 9, in <module>from ._polygon import approximate_polygon, subdivide_polygonFile "/usr/local/lib/python3.5/dist-packages/skimage/measure/_polygon.py", line 2, in <module>from scipy import signalFile "/usr/lib/python3/dist-packages/scipy/signal/__init__.py", line 283, in <module>from .cont2discrete import *File "/usr/lib/python3/dist-packages/scipy/signal/cont2discrete.py", line 12, in <module>from .ltisys import tf2ss, ss2tf, zpk2ss, ss2zpkFile "/usr/lib/python3/dist-packages/scipy/signal/ltisys.py", line 37, in <module>from scipy import integrate, interpolate, linalgFile "/usr/lib/python3/dist-packages/scipy/interpolate/__init__.py", line 158, in <module>from .interpolate import *File "/usr/lib/python3/dist-packages/scipy/interpolate/interpolate.py", line 27, in <module>from .interpnd import _ndim_coords_from_arraysFile "scipy/interpolate/interpnd.pyx", line 1, in init scipy.interpolate.interpnd (scipy/interpolate/interpnd.c:25150)File "/usr/lib/python3/dist-packages/scipy/spatial/__init__.py", line 94, in <module>from ._plotutils import *File "/usr/lib/python3/dist-packages/scipy/spatial/_plotutils.py", line 4, in <module>from scipy._lib.decorator import decorator as _decorator
ImportError: No module named 'scipy._lib.decorator'
解决办法:
卸载掉原来的 scipy并重新安装即可解决问题
卸载:
sudo pip3 uninstall scipy
重新安装scipy:
sudo pip3 install scipy