日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ImportError: libicui18n.so.56 and/or libicui18n.so.58 when importing cv2

發(fā)布時間:2023/12/4 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ImportError: libicui18n.so.56 and/or libicui18n.so.58 when importing cv2 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

自己的解決辦法:

我的報錯是lib中缺少.so.56,于是我從

https://anaconda.org/conda-forge/icu/files

里面下載了放到lib中,python就能正常import cv2了。

再放上比較靠譜的其他人的辦法:

https://github.com/conda-forge/geopandas-feedstock/issues/21

It looks like you have the usual "multiple channes" problem. Please take a look at http://conda-forge.github.io/docs/conda-forge_gotchas.html#using-multiple-channels and let us know if that fixes it for you. (Closing this for now but feel free to ask further questions here in case you are in doubt.)

https://conda-forge.org/docs/conda-forge_gotchas.html#using-multiple-channels

Using multiple channels

It is quite common to install a package from conda-forge and,when trying to use it,see an error like (OS X example):

ImportError: dlopen(.../site-packages/rpy2/rinterface/_rinterface.so, 2): Library not loaded: @rpath/libicuuc.54.dylibReferenced from: .../site-packages/rpy2/rinterface/_rinterface.soReason: image not found

That happens because either the correct version of icu,or any other package in the error,is not present or the package is missing altogether.

Once can confirm by issuing the command conda list and searching for the package in question.

Why that happens?

The conda-forge and defaults are not 100% compatible.In the example above it is known that defaults uses icu 54.* while conda-forge relies on icu 56.*,that mismatch can lead to errors when the install environment is mixing packages from multiple channels.

Note: All of conda-forge software pinning can be found at: https://github.com/conda-forge/staged-recipes/wiki/Pinned-dependencies

How to fix it?

Newer conda versions introduced a channel priority feature.See https://conda.io/docs/channels.html for more information.

One possible solution is to add the conda-forge channel on top of defaults in your condarc file when using conda-forge packages.This will ensuring that all the dependencies will come from the conda-forge channel.Here is how a .condarc file would look like:

$ cat .condarc channels:- conda-forge- defaults

In addition to the channel priority we recommend to always install your packages inside a new environment instead the root environment from anaconda/miniconda.Using envs make it easier to debug problems with packages and ensure the stability of your root env.

https://conda.io/docs/user-guide/tasks/manage-channels.html

Managing channels

Different channels can have the same package, so conda must handle thesechannel collisions.

There will be no channel collisions if you use only the defaults channel.There will also be no channel collisions if all of the channels you use onlycontain packages that do not exist in any of the other channels in your list.The way conda resolves these collisions matters only when you have multiplechannels in your channel list that host the same package.

Before conda 4.1.0

Before conda 4.1.0 was released on June 14, 2016, when two channelshosted packages with the same name, conda installed the packagewith the highest version number. If there were two packageswith the same version number, conda installed the one with thehighest build number. Only if both the version numbers and buildnumbers were identical did the channel ordering make adifference. This approach had 3 problems:

  • Build numbers from different channels are not comparable.Channel A could do nightly builds while Channel B does weeklybuilds, so build 2 from Channel B could be newer than build 4from Channel A.
  • Users could not specify a preferred channel. You might considerChannel B more reliable than Channel A and prefer to getpackages from that channel even if the B version is older thanthe package in Channel A. Conda provided no way to choose thatbehavior. Only version and build numbers mattered.
  • Build numbers conflicted. This is an effect of the other 2problems. Assume you were happily using package Alpha fromChannel A and package Bravo from Channel B. The provider fromChannel B then added a version of Alpha with a very high buildnumber. Your conda updates would start installing new versionsof Alpha from Channel B whether you wanted that or not. Thiscould cause unintentional problems and a risk of deliberateattacks.

After conda 4.1.0

By default, conda now prefers packages from a higher prioritychannel over any version from a lower priority channel.Therefore, you can now safely put channels at the bottom of yourchannel list to provide additional packages that are not in thedefault channels, and still be confident that these channels willnot override the core package set.

Conda collects all of the packages with the same name across alllisted channels and processes them as follows:

  • Sorts packages from highest to lowest channel priority.
  • Sorts tied packages—same channel priority—from highest tolowest version number.
  • Sorts still-tied packages—same channel priority and sameversion—from highest to lowest build number.
  • Installs the first package on the sorted list that satisfiesthe installation specifications.
  • To make conda use the old method and install the newest versionof a package in any listed channel:

    • Add channel_priority: false to your .condarc file.

      OR

    • Run the equivalent command:

      conda config --set channel_priority false

    Conda then sorts as follows:

  • Sorts the package list from highest to lowest version number.
  • Sorts tied packages from highest to lowest channel priority.
  • Sorts tied packages from highest to lowest build number.
  • Because build numbers from different channels are notcomparable, build number still comes after channel priority.

    The following command adds the channel “new_channel” to the topof the channel list, making it the highest priority:

    conda config --add channels new_channel

    Conda now has an equivalent command:

    conda config --prepend channels new_channel

    Conda also now has a command that adds the new channel to thebottom of the channel list, making it the lowest priority:

    conda config --append channels new_channel

    另外icu的開源庫在:

    https://github.com/conda-forge/icu-feedstock






    總結(jié)

    以上是生活随笔為你收集整理的ImportError: libicui18n.so.56 and/or libicui18n.so.58 when importing cv2的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。