无法安装 jpeg,因为冲突的端口处于活动状态:libjpeg-turbo

Can't install jpeg because conflicting ports are active: libjpeg-turbo

我 运行 遇到了 libjpeg-turbo 试图用 Mac 端口安装 vsftpd 的问题。我 运行 OS X 10.10.5.

David-Laxers-MacBook-Pro:phoenix_pipeline davidlaxer$ conda -V
conda 3.16.0

David-Laxers-MacBook-Pro:phoenix_pipeline davidlaxer$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
David-Laxers-MacBook-Pro:phoenix_pipeline davidlaxer$ 

    David-Laxers-MacBook-Pro:phoenix_pipeline davidlaxer$ port -v
MacPorts 2.3.3
sudo port install vsftpd
Password:
--->  Fetching archive for vsftpd
--->  Attempting to fetch vsftpd-3.0.2_1.darwin_14.x86_64.tbz2 from http://packages.macports.org/vsftpd
--->  Attempting to fetch vsftpd-3.0.2_1.darwin_14.x86_64.tbz2.rmd160 from http://packages.macports.org/vsftpd
--->  Installing vsftpd @3.0.2_1
--->  Activating vsftpd @3.0.2_1

To configure vsftpd edit /opt/local/etc/vsftpd.conf.

--->  Cleaning vsftpd
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  Found 99 broken file(s), matching files to ports   
--->  Found 14 broken port(s), determining rebuild order
--->  Rebuilding in order
     tiff @4.0.4 
     gd2 @2.1.1 +x11
     ghostscript @9.16 +x11
     djvulibre @3.5.27 
     webp @0.4.3 
     jasper @1.900.1 
     gdk-pixbuf2 @2.31.6 +x11
     opencv @3.0.0 
     lcms @1.19 
     libmng @1.0.10 
     netpbm @10.71.02 +x11
     lcms2 @2.7 
     ImageMagick @6.9.0-0 +x11
     poppler @0.35.0 

Error: Unable to exec port: Can't install jpeg because conflicting ports are active: libjpeg-turbo
Error rebuilding tiff
    while executing
"error "Error rebuilding $portname""
    (procedure "revupgrade_scanandrebuild" line 395)
    invoked from within
"revupgrade_scanandrebuild broken_port_counts $opts"
    (procedure "macports::revupgrade" line 5)
    invoked from within
"macports::revupgrade $opts"
    (procedure "action_revupgrade" line 2)
    invoked from within
"action_revupgrade $action $portlist $opts"
    (procedure "action_target" line 96)
    invoked from within
"$action_proc $action $portlist [array get global_options]"
    (procedure "process_cmd" line 103)
    invoked from within
"process_cmd $remaining_args"
    invoked from within
"if { [llength $remaining_args] > 0 } {

    # If there are remaining arguments, process those as a command
    set exit_status [process_cmd $remaining..."
    (file "/opt/local/bin/port" line 5268)

我今天早些时候遇到了与 python-goose 类似的问题:

David-Laxers-MacBook-Pro:python-goose davidlaxer$ anaconda search -t conda libjpg
Traceback (most recent call last):
 File "/users/davidlaxer/anaconda/bin/anaconda", line 6, in <module>
   sys.exit(main())
 File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/binstar_client/scripts/cli.py", line 94, in main
   description=__doc__, version=version)
 File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/binstar_client/scripts/cli.py", line 60, in binstar_main
   add_subparser_modules(parser, sub_command_module, 'conda_server.subcommand')
 File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/clyent/__init__.py", line 117, in add_subparser_modules
   for command_module in get_sub_commands(module):
 File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/clyent/__init__.py", line 106, in get_sub_commands
   this_module = __import__(module.__package__ or module.__name__, fromlist=names)
 File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/binstar_client/commands/notebook.py", line 13, in <module>
   from binstar_client.utils.notebook import Uploader, Downloader, parse, notebook_url, has_environment
 File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/binstar_client/utils/notebook/__init__.py", line 10, in <module>
   from .uploader import *
 File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/binstar_client/utils/notebook/uploader.py", line 7, in <module>
   from .data_uri import data_uri_from
 File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/binstar_client/utils/notebook/data_uri.py", line 10, in <module>
   from PIL import Image
 File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/PIL/Image.py", line 63, in <module>
   from PIL import _imaging as core
ImportError: dlopen(/Users/davidlaxer/anaconda/lib/python2.7/site-packages/PIL/_imaging.so, 2): Library not loaded: libjpeg.8.dylib
 Referenced from: /Users/davidlaxer/anaconda/lib/python2.7/site-packages/PIL/_imaging.so
 Reason: Incompatible library version: _imaging.so requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0

Continuum Analytics 给了我这些说明(解决了 'goose' 问题):

conda install -f pillow jpeg
I was unable to find any details of a jpeg package that has _imaging.so 13. My suggestion from here may be to reinstall goose. I did so by the following. first download the zip from https://github.com/grangier/python-goose and run the following individually.

conda create -n goose python=2.7 anaconda-client pillow lxml cssselect nltk

source activate goose

pip install -i https://pypi.anaconda.org/pypi/simple jieba

conda install -fc https://conda.anaconda.org/auto beautifulsoup4
Then move the contents of the python-goose-develop/ into the goose environment, similar to this.

cp ~/Downloads/python-goose-develop/* ~/anaconda/envs/goose

cd ~/anaconda/envs/goose

python setup.py install

回应以下来自 dsgfdg 的 'answer'。

David-Laxers-MacBook-Pro:phoenix_pipeline davidlaxer$ sudo !!
sudo port install webp
--->  Computing dependencies for webp
Error: Unable to execute port: Can't install jpeg because conflicting ports are active: libjpeg-turbo

我下载了 Pillow 2.3.1 并构建了它。 它构建成功,但随后未能通过测试。这是摘录。

David-Laxers-MacBook-Pro:Pillow-2.3.1 davidlaxer$ python Tests/run.py
--------------------------------------------------------------------
running test_000_sanity ...
=== error 256
Traceback (most recent call last):
  File "Tests/test_000_sanity.py", line 5, in <module>
    import PIL.Image
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/Image.py", line 53, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 7, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so, 2): Library not loaded: libjpeg.8.dylib
  Referenced from: /Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so
  Reason: Incompatible library version: _imaging.so requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0
running test_001_archive ...
=== error 256
Traceback (most recent call last):
  File "Tests/test_001_archive.py", line 2, in <module>
    import PIL.Image
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/Image.py", line 53, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 7, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so, 2): Library not loaded: libjpeg.8.dylib
  Referenced from: /Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so
  Reason: Incompatible library version: _imaging.so requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0
running test_file_bmp ...
=== error 256
Traceback (most recent call last):
  File "Tests/test_file_bmp.py", line 3, in <module>
    from PIL import Image
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/Image.py", line 53, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 7, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so, 2): Library not loaded: libjpeg.8.dylib
  Referenced from: /Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so
  Reason: Incompatible library version: _imaging.so requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0
running test_file_eps ...
=== error 256
Traceback (most recent call last):
  File "Tests/test_file_eps.py", line 3, in <module>
    from PIL import Image, EpsImagePlugin
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/Image.py", line 53, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 7, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so, 2): Library not loaded: libjpeg.8.dylib
  Referenced from: /Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so
  Reason: Incompatible library version: _imaging.so requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0
running test_file_fli ...
=== error 256
Traceback (most recent call last):
  File "Tests/test_file_fli.py", line 3, in <module>
    from PIL import Image
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/Image.py", line 53, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 7, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so, 2): Library not loaded: libjpeg.8.dylib
  Referenced from: /Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so
  Reason: Incompatible library version: _imaging.so requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0
running test_file_gif ...
=== error 256
Traceback (most recent call last):
  File "Tests/test_file_gif.py", line 3, in <module>
    from PIL import Image
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/Image.py", line 53, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 7, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 6, in __bootstrap__

...

ImportError: dlopen(/Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so, 2): 库未加载:libjpeg.8.dylib 参考自:/Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so 原因:不兼容的库版本:_imaging.so 需要 13.0.0 或更高版本,但 libjpeg.8.dylib 提供 12.0.0 版本 ---------------------------------------------- ------------------ *** 94 次测试中的 94 次失败。 David-Laxers-MacBook-Pro:Pillow-2.3.1 davidlaxer$

David-Laxers-MacBook-Pro:scraper davidlaxer$ python scraper.py
Traceback (most recent call last):
  File "scraper.py", line 8, in <module>
    from goose import Goose
  File "/users/davidlaxer/anaconda/lib/python2.7/site-packages/goose/__init__.py", line 27, in <module>
    from goose.crawler import CrawlCandidate
  File "/users/davidlaxer/anaconda/lib/python2.7/site-packages/goose/crawler.py", line 31, in <module>
    from goose.images.extractors import UpgradedImageIExtractor
  File "/users/davidlaxer/anaconda/lib/python2.7/site-packages/goose/images/extractors.py", line 28, in <module>
    from goose.images.utils import ImageUtils
  File "/users/davidlaxer/anaconda/lib/python2.7/site-packages/goose/images/utils.py", line 26, in <module>
    from PIL import Image
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/Image.py", line 53, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 7, in <module>
  File "build/bdist.macosx-10.5-x86_64/egg/PIL/_imaging.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so, 2): Library not loaded: libjpeg.8.dylib
  Referenced from: /Users/davidlaxer/.python-eggs/Pillow-2.3.1-py2.7-macosx-10.5-x86_64.egg-tmp/PIL/_imaging.so
  Reason: Incompatible library version: _imaging.so requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0

问题是MacPorts中的libjpeg-turbojpeg端口都提供了libjpeg.dylib和对应的头文件(因此相互冲突,不能同时安装),但是 jpeg 端口运送 libjpeg.9.dylib,它与 libjpeg-turbolibjpeg.8.dylib.

不兼容

问题不是安装vsftpd端口引起的;相反,MacPorts 在每次安装或更新后运行完整性检查,称为 rev-upgrade,检查 ABI 兼容性问题,例如引用不存在或不兼容的库。当它检测到此类问题时(如您的情况),它会尝试重建损坏的端口以解决问题。

此完整性检查确定您的 tiff 端口已损坏,因为它的二进制文件或库之一链接到 libjpeg.9.dylib -- 此文件不存在,因为它是由 jpeg 端口,但你只安装了 libjpeg-turbo。然后重建尝试将 jpeg 端口安装为 tiff 的依赖项,但由于冲突而失败。

此时您有多种选择:

  • 卸载 libjpeg-turbo 并安装 jpeg。这应该可以解决您的问题,但如果您出于某种原因不明确想要 libjpeg-turbo,那只是一个选择。
  • 卸载所有明确依赖 jpeg 端口的端口,并重建那些将接受 libjpeg-turbo 作为 libjpeg.dylib 库提供者的端口;不幸的是, tiff 端口目前不在其中:
    $> port info --depends_lib tiff
    depends_lib: port:jpeg, port:xz, port:zlib
    
    这将包含 path:lib/libjpeg.dylib:jpeg 如果它支持两个版本。一项快速调查表明,目前 MacPorts 中只有极少数端口支持 libjpeg-turbo 以提供 JPEG 功能。这在未来可能会发生变化(事实上,最近在邮件列表中对此进行了讨论)。

TL;DR:

sudo port -f uninstall libjpeg-turbo
sudo port install jpeg
sudo port rev-upgrade