Linux中使用pip安装库时出现Aborted (core dumped)问题解决方案

(作者:陈玓玏)
在Linux中安装上pip后,通过pip install安装python库时出现这个问题:

root@DZG0370:/mnt/c/Windows/System32# pip3 install pandas
Downloading/unpacking pandas
python3: ../sysdeps/posix/getaddrinfo.c:2591: getaddrinfo: Assertion `(__extension__ ({ const struct in6_addr *__a = (const struct in6_addr *) (sin6->sin6_addr.__in6_u.__u6_addr32); __a->__in6_u.__u6_addr32[0] == 0 && __a->__in6_u.__u6_addr32[1] == 0 && __a->__in6_u.__u6_addr32[2] == __bswap_32 (0xffff); }))' failed.
Aborted (core dumped)

安装好几个包都是,猜测可能的原因:网络问题,因为我没有更改镜像源,所以可能连不上外网,就会出现这个错,因为我后来又试了一次,就可以,所以猜测是因为网络原因出现的错误。

解决方案:1)要么就是连外网,2)更改为国内镜像源,3)直接把源码下载下来安装,但是要自己解压自己编译。

小提示:很多源码都是C++写的,所以编译时需要用到gcc和cmake,需要先通过apt-get install下载这两个,可以看一篇具体的例子,通过源码安装xlearn库的例子:https://blog.csdn.net/weixin_39750084/article/details/84894603。

参考文章:https://www.cnblogs.com/lxmhhy/p/6029465.html

你可能感兴趣的:(Python,Linux)