安装相关的依赖库和工具
sudo apt-get install libhdf5-serial-dev hdf5-tools zlib1g-dev zip libjpeg8-dev libhdf5-dev python3-pip
系统里面默认是没有python3-pip的,所以需要自己安装。
pip的配置
修改配置文件
cd ~
mkdir .pip
vim .pip/pip.conf # 将上述配置内容写入配置文件即可
[global]
trusted-host = mirrors.aliyun.com
index-url = http://mirrors.aliyun.com/pypi/simple
安装python相关的库
sudo pip3 install -U numpy # 需要编译安装,用时很长,所以单独安装
sudo pip3 install -U grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast astor termcolor
如果报这个错
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-zdje0irm/h5py/
试试下面这条命令
sudo pip3 install --upgrade setuptools
感谢分享