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

自己的解决办法:

我的报错是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:

  1. Sorts packages from highest to lowest channel priority.
  2. Sorts tied packages—same channel priority—from highest tolowest version number.
  3. Sorts still-tied packages—same channel priority and sameversion—from highest to lowest build number.
  4. 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:

  1. Sorts the package list from highest to lowest version number.
  2. Sorts tied packages from highest to lowest channel priority.
  3. 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






本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/313115.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

微软发布 SQL Server 2019 新版本

2019 年 11 月 4 日,微软在美国奥兰多举办的 Ignite 大会上发布了关系型数据库 SQL Server 的新版本。与之前版本相比,新版本的 SQL Server 2019 具备以下重要功能:在 Linux 和容器中运行的能力,连接大数据存储系统的 PolyBase 技…

Ubuntu下查看显卡型号及NVIDIA驱动版本

查看GPU型号 lspci | grep -i nvidia查看NVIDIA驱动版本 sudo dpkg --list | grep nvidia-*http://gwang-cv.github.io/2017/08/07/Ubuntu%E4%B8%8B%E6%9F%A5%E7%9C%8B%E6%98%BE%E5%8D%A1%E5%9E%8B%E5%8F%B7%E5%8F%8ANVIDIA%E9%A9%B1%E5%8A%A8%E7%89%88%E6%9C%AC/

Visual Studio Online,带来四种开发模式,未来已来。

简单来说,Visual Studio Online 由两部分组成:“前端”与“后端”。 “前端”:VS Code、VS IDE 和 Web 版 VS Code。“后端”:由云服务支撑的开发环境。 Visual Studio Online 的前端可以是本地的 VS Code 或者 VS IDE&#xff0c…

AdminLTE 3.0发布了

点击蓝字关注我们前言在11月2日,作者正式发布了AdminLTE 3.0版本。该版本基于Bootstrap 4.x。使用Bootstrap 4.x的小伙伴可以愉快的使用AdminLTE。GithubAdminLTE是一个完全响应的管理模板。基于Bootstrap 4框架。高度可定制且易于使用。适合从小型移动设备到大型台…

ubuntu改变进程优先级从而防止卡

http://blog.csdn.net/loyachen/article/details/52167124 nice 还有一个关联命令叫做 renice,它可以在运行时调整进程的 nice 值。使用 renice 命令时,要先找出进程的 PID。下面是一个例子: renice 10 12341 其中,1234是进程…

这位优秀的.NET开发者是怎样炼成的?

本文来自DotNET技术圈作者:邹溪源一,社区的小圈子今年3月的一次技术交流活动上,那是我们.NET技术社区第一次组织线下活动,由于没什么经验,所以活动组织得比较仓促,内容也比较一般,效果还是有点欠…

Block Coordinate Descent

http://www.math.ucla.edu/~wotaoyin/papers/bcu/

求知无限,刷新.NET 中国社区

2019 Microsoft Ignite The Tour 2020年1月13日至14日深圳会展中心举办,今年的大会是免费的哦,所以也很火爆,我们为您开通专属报名渠道,,扫下方二位码 请在注册时务必填写RSVPCode: MITTCE。大会全面解锁微软黑科技:&g…

使用ASP.NET Core 3.x 构建 RESTful API - 1. 开始

以前写过ASP.NET Core 2.x的REST API文章,今年再更新一下到3.0版本。预备知识:ASP.NET Core 和 C# 工具:Visual Studio 2019最新版(VSCode、VS for Mac,Rider等也凑合),POSTMAN Web API Web API…

matlab处理中文路径

https://www.douban.com/note/387532266/matlab读取文本文件很方便,textread,textscan等就能搞定。如果整个文件仅包含数字,则有更方便的命令"load".但是一旦文件包含中文,则往往读出来的是乱码。经过搜索测试,发现救命…

.NET Core 3.1 编写混合 C++ 程序

前言随着 .NET Core 3.1 的第二个预览版本发布,微软正式将 C/CLI 移植到 .NET Core 上,从此可以使用 C 编写 .NET Core 的程序了。由于目前仅有 MSVC 支持编译此类混合代码,并且由于涉及到非托管代码,因此 C/CLI 目前不能跨平台&a…

ubuntu 16.04 安装 python2.7 以及 cv2, dist-package 和 site-package 的区别, import cv2 出问题解答

ubuntu16.04默认安装python3以上,需要手动安装2.7。1、先确保make、gcc、g已经安装好,如果没有则需要先安装这三个程序,均使用apt-get的方式直接装; 2、下载python2.7包:wget https://www.python.org/ftp/python/2.7.1…

在ASP.NET Core中编写合格的中间件

这篇文章探讨了让不同的请求去使用不同的中间件,那么我们应该如何配置ASP.NET Core中间件?其实中间件只是在ASP.NET Core中处理Web请求的管道。所有ASP.NET Core应用程序至少需要一个中间件来响应请求,并且您的应用程序实际上只是中间件的集合…

nvcc找不到的问题(Ubuntu16.04 CUDA 8.0)

http://blog.csdn.net/rtygbwwwerr/article/details/73656876在terminal中输入nvcc,也是提示找不到command。但是可以确定的是,CUDA8.0,以及nvidia-cuda-toolkit已经从官方网站下载并正确安装。 于是网上找了教程,说是需要在termi…

全网首发 PowerBI 秒级实时大屏通用解决方案

双十一来了,你准备好了吗?不管你是否准备完毕,我们带来了全网首发的 PowerBI 秒级实时大屏展示方案,你可以直接用来展示双十一的实时状况。我们一步步来说明这个套件模板教程。真实效果功能如下:全实时展示 双十一 当天…

windows 编译 caffe unresolved externals 问题

windows 10 编译基于 caffe 的工程, 由于github上作者所用到的版本各不相同,版本是导致问题的根本。 遇到 LNK20xx error unresolved externals,先找是哪个.obj 造成的, 这种link问题是由声明不正确造成的,我们找到那个…

普大喜奔 | Azure 免费送网站SSL证书啦!

点击上方蓝字关注“汪宇杰博客”导语就在今晨,微软推出了 App Service Managed Certificates 预览版。简单来说,这就是在 Azure App Service 服务的一项更新,免费送你SSL证书!只要点几下鼠标就能给网站加上SSL证书!并且…

VS Code 1.40 发布!可自行搭建 Web 版 VS Code!

今天(北京时间 2019 年 11 月 8 日),微软发布了 Visual Studio Code 1.40 版本。让我们来看看有哪些主要的更新。自建 Web 版 VS Code 如果你已经下载了 VS Code 在 GitHub 上的源代码,只需运行 yarn web,就能在 http:…