python3安装pandas执行pip3 install pandas命令后卡住不动的问题及安装scipysklearn库的numpy.distutils.system_info.NotFound(

Posted UFOFCZ

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python3安装pandas执行pip3 install pandas命令后卡住不动的问题及安装scipysklearn库的numpy.distutils.system_info.NotFound(相关的知识,希望对你有一定的参考价值。

  一直尝试在python3中安装pandas等一系列软件,但每次执行pip3 install pandas后就卡住不动了,一直停在那,开始以为是pip命令的版本不对,还执行过 python -m pip3 install -U pip3 升级命令,发现还是不行。有了上一篇python2中安装的经验可知肯定是numpy的版本不对,查看 /usr/lib/python3/dist-packages 目录下查看发现确实是1.8的版本,而从python2中的经验可知应该至少得1.9.0以上的版本。

1. 卸载当前numpy版本,sudo pip uninstall numpy 命令后报错 Not uninstalling numpy at /usr/lib/python2.7/dist-packages, owned by OS, 按照 https://blog.csdn.net/TYOUKAI_/article/details/78116912#commentBox 经验rm -rf numpy-1.8.2.egg-info 删除了/usr/lib/python3/dist-packages 目录下文件后,再执行sudo pip uninstall numpy 命令就报未安装numpy了。所以就直接装1.9.0的numpy吧,居然装上了,然后装pandas居然也能装上了,然后测试导入pandas就报错误:需要1.9.0以上版本的numpy。看来还是只识别到了上一版本。所以又把numpy和pandas卸载了,测试导入numpy发现确实还可以导入,说明1.8版本还在。然后把/usr/lib/python3/dist-packages 目录下的numpy目录给删除了,再导入numpy就报未安装numpy了。然后再sudo pip3 install numpy==1.9.0把numpy装上,再把pandas装上,都耗时比较久。不过最终可以了。

2.本来想直接安装sklearn的,但需要scipy;安装scipy但要求正确版本的numpy及库。完成上面的1后,继续安装scipy,然后报错 numpy.distutils.system_info.NotFoundError: no lapack/blas resources found ,搜索得知少了一些库,根据 https://blog.csdn.net/up_com/article/details/51334411 的经验执行 sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran  命令后把这些库装上了,继续 sudo pip3 install scipy 和 sudo pip3 install sklearn 后都装上了。

以上是关于python3安装pandas执行pip3 install pandas命令后卡住不动的问题及安装scipysklearn库的numpy.distutils.system_info.NotFound(的主要内容,如果未能解决你的问题,请参考以下文章

Cygwin上的Python3.6无法安装模块

Python3与pip3的安装

Ubuntu18.04 升级python3后 安装pip3 后报错

在 debian10 中在不同的 python 版本上安装 pandas

python3.6执行pip3时 Unable to create process using '"'

Ubuntu系统下,pip3安装python3的pymysql包 报错的问题