matplotlib 导入错误:第9章:无法打开共享对象文件:无此文件或目录

5uzkadbs  于 2022-12-13  发布在  其他
关注(0)|答案(2)|浏览(166)

我尝试导入matplotlib,然后导入skimage.io,但遇到了一些问题。我该怎么办?

import matplotlib

ImportError: 
    Could not load requested Qt binding. Please ensure that
    PyQt4 >= 4.7 or PySide >= 1.0.3 is available,
    and only one is imported per session.
    Currently-imported Qt library:   None
    PyQt4 installed:                 False
    PyQt5 installed:                 True
    PySide >= 1.0.3 installed:       True
    Tried to load:                   ['pyqtdefault']

matplotlib.use('QT5Agg')
import matplotlib.pyplot as plt
from ggplot import *

import numpy as np
from scipy import stats
from pandas import DataFrame
import pandas as pd
import cv2
import os
from  itertools import chain

import skimage.io

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "[...]/PyCharm/pycharm-community-2016.3.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "[...]/anaconda2/envs/saliency/lib/python2.7/site-packages/skimage/io/__init__.py", line 7, in <module>
    from .manage_plugins import *
  File "[...]/PyCharm/pycharm-community-2016.3.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "[...]/anaconda2/envs/saliency/lib/python2.7/site-packages/skimage/io/manage_plugins.py", line 28, in <module>
    from .collection import imread_collection_wrapper
  File "[...]/PyCharm/pycharm-community-2016.3.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "[...]/anaconda2/envs/saliency/lib/python2.7/site-packages/skimage/io/collection.py", line 12, in <module>
    from PIL import Image
  File "[...]/PyCharm/pycharm-community-2016.3.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "[...]/anaconda2/envs/saliency/lib/python2.7/site-packages/PIL/Image.py", line 67, in <module>
    from PIL import _imaging as core
  File "[...]/PyCharm/pycharm-community-2016.3.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: libjpeg.so.9: cannot open shared object file: No such file or directory

以下是我从conda list安装的软件包:

backports                 1.0                      py27_0    defaults
backports-abc             0.5                       <pip>
backports.shutil-get-terminal-size 1.0.0                     <pip>
backports.ssl-match-hostname 3.4.0.2                   <pip>
backports_abc             0.5                      py27_0    defaults
beautifulsoup4            4.3.2                     <pip>
bleach                    1.5.0                    py27_0    defaults
brewer2mpl                1.4.1                    py27_2    conda-forge
cairo                     1.12.18                       6    defaults
certifi                   2017.1.23                py27_0    conda-forge
configparser              3.5.0                    py27_0    defaults
coursera                  0.0.3                     <pip>
cycler                    0.10.0                   py27_0    defaults
dbus                      1.10.10                       0    defaults
decorator                 4.0.11                   py27_0    defaults
entrypoints               0.2.2                    py27_1    defaults
enum34                    1.1.6                    py27_0    defaults
expat                     2.1.0                         0    defaults
fontconfig                2.11.1                        6    defaults
freetype                  2.5.5                         2    defaults
functools32               3.2.3.2                  py27_0    defaults
get_terminal_size         1.0.0                    py27_0    defaults
gettext                   0.19.7                        1    conda-forge
ggplot                    0.11.5                   py27_1    conda-forge
glib                      2.50.2                        1    defaults
graphite2                 1.3.9                         0    conda-forge
gst-plugins-base          1.8.0                         0    defaults
gstreamer                 1.8.0                         0    defaults
harfbuzz                  0.9.39                        1    defaults
html5lib                  0.999                    py27_0    defaults
icu                       54.1                          0    defaults
ipykernel                 4.5.2                    py27_0    defaults
ipython                   5.3.0                    py27_0    defaults
ipython-genutils          0.1.0                     <pip>
ipython_genutils          0.1.0                    py27_0    defaults
ipywidgets                6.0.0                    py27_0    defaults
jbig                      2.1                           0    defaults
jinja2                    2.9.5                    py27_0    defaults
jpeg                      8d                            2    defaults
jsonschema                2.5.1                    py27_0    defaults
jupyter                   1.0.0                    py27_3    defaults
jupyter-client            5.0.0                     <pip>
jupyter-console           5.1.0                     <pip>
jupyter-core              4.3.0                     <pip>
jupyter_client            5.0.0                    py27_0    defaults
jupyter_console           5.1.0                    py27_0    defaults
jupyter_core              4.3.0                    py27_0    defaults
libffi                    3.2.1                         1    defaults
libgcc                    5.2.0                         0    defaults
libgfortran               3.0.0                         1    defaults
libiconv                  1.14                          0    defaults
libpng                    1.6.28                        0    conda-forge
libsodium                 1.0.10                        0    defaults
libtiff                   4.0.6                         3    defaults
libxcb                    1.12                          1    defaults
libxml2                   2.9.4                         0    defaults
markupsafe                0.23                     py27_2    defaults
matplotlib                2.0.0               np112py27_2    conda-forge
mistune                   0.7.4                    py27_0    defaults
mkl                       2017.0.1                      0    defaults
nbconvert                 5.1.1                    py27_0    defaults
nbformat                  4.3.0                    py27_0    defaults
networkx                  1.11                     py27_0    defaults
notebook                  4.4.1                    py27_0    defaults
numpy                     1.12.0                   py27_0    defaults
olefile                   0.44                     py27_0    defaults
opencv-python             3.2.0.6                   <pip>
openssl                   1.0.2k                        1    defaults
pandas                    0.19.2              np112py27_1    conda-forge
pandocfilters             1.4.1                    py27_0    defaults
pango                     1.39.0                        0    defaults
path.py                   10.1                     py27_0    defaults
pathlib2                  2.2.0                    py27_0    defaults
patsy                     0.4.1                    py27_0    defaults
pcre                      8.39                          1    defaults
pexpect                   4.2.1                    py27_0    defaults
pickleshare               0.7.4                    py27_0    defaults
pillow                    4.0.0                    py27_1    defaults
pip                       9.0.1                    py27_1    defaults
pixman                    0.32.6                        0    defaults
prompt-toolkit            1.0.13                    <pip>
prompt_toolkit            1.0.13                   py27_0    defaults
ptyprocess                0.5.1                    py27_0    defaults
pyasn1                    0.1.7                     <pip>
pycairo                   1.10.0                   py27_0    defaults
pygments                  2.2.0                    py27_0    defaults
pyparsing                 2.1.4                    py27_0    defaults
pyqt                      5.6.0                    py27_2    defaults
pyside                    1.2.1                    py27_1    defaults
python                    2.7.13                        0    defaults
python-dateutil           2.6.0                    py27_0    defaults
pytz                      2016.10                  py27_0    defaults
pyzmq                     16.0.2                   py27_0    defaults
qt                        5.6.0                         0    defaults
qtconsole                 4.2.1                    py27_1    defaults
readline                  6.2                           2    defaults
requests                  2.7.0                     <pip>
scandir                   1.5                      py27_0    defaults
scikit-image              0.12.3              np112py27_1    defaults
scikit-learn              0.18.1              np112py27_1    defaults
scipy                     0.19.0              np112py27_0    defaults
setuptools                27.2.0                   py27_0    defaults
shiboken                  1.2.1                    py27_0    defaults
simplegeneric             0.8.1                    py27_1    defaults
singledispatch            3.4.0.3                  py27_0    defaults
sip                       4.18                     py27_0    defaults
six                       1.10.0                   py27_0    defaults
sqlite                    3.13.0                        0    defaults
ssl_match_hostname        3.4.0.2                  py27_1    defaults
statsmodels               0.8.0               np112py27_0    defaults
subprocess32              3.2.7                    py27_0    defaults
terminado                 0.6                      py27_0    defaults
testpath                  0.3                      py27_0    defaults
tk                        8.5.18                        0    defaults
tornado                   4.4.2                    py27_0    defaults
traitlets                 4.3.2                    py27_0    defaults
urllib3                   1.10.4                    <pip>
wcwidth                   0.1.7                    py27_0    defaults
wheel                     0.29.0                   py27_0    defaults
widgetsnbextension        2.0.0                    py27_0    defaults
xorg-libxau               1.0.8                         3    conda-forge
xorg-libxdmcp             1.1.2                         3    conda-forge
xz                        5.2.2                         1    defaults
zeromq                    4.1.5                         0    defaults
zlib                      1.2.8                         3    defaults
nr9pn0ug

nr9pn0ug1#

确保.. anaconda/lib/文件夹下有libjpeg.so.9文件。如果有旧版本可用,例如libjpeg.so.8,则输入terminal conda update -c conda-forge jpeg更新该文件

4sup72z8

4sup72z82#

我用sudo apt install libjpeg9解决了这个问题

相关问题