【问题标题】:How install python3-poppler-qt5 on my mac如何在我的 Mac 上安装 python3-poppler-qt5
【发布时间】:2020-04-20 10:43:03
【问题描述】:

我希望在我的 Mac 上安装此软件 (https://github.com/alexisflesch/texamator)。

为此,我安装了 Python,但我还需要安装 python3-pyqt5python3-poppler-qt5。但我收到一条错误消息。

我的第一个:

    $ pip install PyQt5
Collecting PyQt5
  Downloading https://files.pythonhosted.org/packages/1e/8f/dd8312af6ed44c15419fb14c38b6532eeb765c428f0642e30dc3ef26b6d4/PyQt5-5.14.0-5.14.0-cp35.cp36.cp37.cp38-abi3-macosx_10_6_intel.whl (43.0MB)
     |████████████████████████████████| 43.0MB 172kB/s 
Collecting PyQt5-sip<13,>=12.7 (from PyQt5)
  Downloading https://files.pythonhosted.org/packages/ca/77/ac0e8908be37523f0d93b8002641d11cfbc231c3e9dbaa4835f8073b397d/PyQt5_sip-12.7.0-cp37-cp37m-macosx_10_9_x86_64.whl (62kB)
     |████████████████████████████████| 71kB 843kB/s 
ERROR: spyder 3.3.6 requires pyqtwebengine<5.13; python_version >= "3", which is not installed.
ERROR: spyder 3.3.6 has requirement pyqt5<5.13; python_version >= "3", but you'll have pyqt5 5.14.0 which is incompatible.
Installing collected packages: PyQt5-sip, PyQt5
Successfully installed PyQt5-5.14.0 PyQt5-sip-12.7.0

似乎没问题,第二次我得到:

$ pip install python-poppler-qt5
Collecting python-poppler-qt5
  Downloading https://files.pythonhosted.org/packages/6a/7d/65a14ece5dd6a1564b576c1ca30b0f5639be64cc55b62b4d2b497159ed43/python-poppler-qt5-0.75.0.tar.gz
Building wheels for collected packages: python-poppler-qt5
  Building wheel for python-poppler-qt5 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-install-mfn34q87/python-poppler-qt5/setup.py'"'"'; __file__='"'"'/private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-install-mfn34q87/python-poppler-qt5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-wheel-5y95ji3s --python-tag cp37
       cwd: /private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-install-mfn34q87/python-poppler-qt5/
  Complete output (15 lines):
  Package poppler-qt5 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `poppler-qt5.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'poppler-qt5' found
  running bdist_wheel
  running build
  running build_ext
  building 'popplerqt5' extension
  Package poppler-qt5 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `poppler-qt5.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'poppler-qt5' found
  /opt/anaconda3/bin/sip -I /opt/anaconda3/share/sip -t POPPLER_V0_20_0 -c build/temp.macosx-10.9-x86_64-3.7 -b build/temp.macosx-10.9-x86_64-3.7/poppler-qt5.sbf -I /opt/anaconda3/share/sip/PyQt5 -n PyQt5.sip -t Qt_5_14_0 -t WS_MACX poppler-qt5.sip
  sip: Usage: sip [-h] [-V] [-a file] [-b file] [-B tag] [-c dir] [-d file] [-D] [-e] [-f] [-g] [-I dir] [-j #] [-k] [-m file] [-o] [-p module] [-P] [-r] [-s suffix] [-t tag] [-w] [-x feature] [-X id:file] [-y file] [-z file] [@file] [file]
  error: command '/opt/anaconda3/bin/sip' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for python-poppler-qt5
  Running setup.py clean for python-poppler-qt5
Failed to build python-poppler-qt5
Installing collected packages: python-poppler-qt5
  Running setup.py install for python-poppler-qt5 ... error
    ERROR: Command errored out with exit status 1:
     command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-install-mfn34q87/python-poppler-qt5/setup.py'"'"'; __file__='"'"'/private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-install-mfn34q87/python-poppler-qt5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-record-1jvxu2r8/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-install-mfn34q87/python-poppler-qt5/
    Complete output (15 lines):
    Package poppler-qt5 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `poppler-qt5.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'poppler-qt5' found
    running install
    running build
    running build_ext
    building 'popplerqt5' extension
    Package poppler-qt5 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `poppler-qt5.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'poppler-qt5' found
    /opt/anaconda3/bin/sip -I /opt/anaconda3/share/sip -t POPPLER_V0_20_0 -c build/temp.macosx-10.9-x86_64-3.7 -b build/temp.macosx-10.9-x86_64-3.7/poppler-qt5.sbf -I /opt/anaconda3/share/sip/PyQt5 -n PyQt5.sip -t Qt_5_14_0 -t WS_MACX poppler-qt5.sip
    sip: Usage: sip [-h] [-V] [-a file] [-b file] [-B tag] [-c dir] [-d file] [-D] [-e] [-f] [-g] [-I dir] [-j #] [-k] [-m file] [-o] [-p module] [-P] [-r] [-s suffix] [-t tag] [-w] [-x feature] [-X id:file] [-y file] [-z file] [@file] [file]
    error: command '/opt/anaconda3/bin/sip' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-install-mfn34q87/python-poppler-qt5/setup.py'"'"'; __file__='"'"'/private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-install-mfn34q87/python-poppler-qt5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/sf/8b0lljnn487_0hth46wr7j8w0000gn/T/pip-record-1jvxu2r8/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

我不明白为什么以及如何纠正。

我也做过:

$ pip search poppler
python-poppler-qt4 (0.24.0)  - A Python binding to Poppler-Qt4
python-poppler-qt5 (0.75.0)  - A Python binding to Poppler-Qt5
pdfparser-si (0.2.6)         - python bindings for poppler
pdfparser-rossum (1.3.3)     - python bindings for poppler
pdflib (0.2.1)               - python bindings for poppler
pypoppler (0.12.2)           - Python bindings for poppler-glib, unofficial
                               branch including bug fixes, and removal of gtk
                               dependencies

通常我使用 Homebrew 来安装不同的包。

【问题讨论】:

  • 你解决了这个问题吗?
  • 您最初是如何安装 Python 3 的?你似乎有 Anaconda;可能是edit你的问题,详细说明。

标签: python python-3.x macos anaconda


【解决方案1】:

最后,我的建议是使用 Macports 包管理器来安装 Python3、pyqt5 和 poppler-pyqt5。

sudo port install pyqt5
sudo port install python-poppler-qt5

我尝试使用 PIP,但 PIP 没有完全安装 SIP。使用 Homebrew 包管理器时,我遇到了其他无法修复的错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-25
    • 2011-08-31
    • 2018-03-27
    • 2017-05-26
    • 2019-10-10
    • 1970-01-01
    相关资源
    最近更新 更多