1.Anaconda在安装第三方库的时候,超时报错
报错内容为:
…
socket.timeout: The read operation timed out
…
ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.
解决方案
写如下代码(网上查到的):
pip --default-timeout=100 install -U opencv-python
其中最后-U后边的是你要pip install 安装的库,根据你的需求可以更改。但是我在安装opencv-python时还是解决不了,可能是超时太久,于是改为(我的):
pip --default-timeout=200 install -U opencv-python
完美解决!
2.运行程序后报错
module compiled against API version 0xc but this version of numpy is 0xb
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core.umath failed to import
ImportError: numpy.core.umath failed to import
程序需要的API版本和自己的版本不符。
解决方案
输入如下代码:
pip install numpy --upgrade
输入后系统自己卸载低版本的numpy,安装需要的版本。
3.警告
FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type
.
警告原因:h5py版本和numpy版本不兼容
解决方案
1.对h5py进行升级(推荐)
pip install h5py --upgrade
2.对numpy升级
pip install numpy --upgrade
(我也刚接触Python不久,也就是写个帖子记录自己的小问题,如有错误欢迎指出,欢迎大家互相交流)