Linux使用pip3和pip安装numpy,scipy,matplotlib等第三方库

mantoureganmian 2019-03-20

Linux安装Python3第三方库numpy,scipy,matplotlib:

Linux使用pip3和pip安装numpy,scipy,matplotlib等第三方库

sudo apt install python3-pip
pip3 install numpy
pip3 install scipy
pip3 install matplotlib

报错,安装matplotlib库需要安装python3-tk库:

sudo apt-get install python3-tk
pip3 install matplotlib

报错,安装matplotlib库需要安装nose库:

pip3 install nose

安装图像处理库:

pip3 install pillow

通过 from PIL import Image 测试是否安装成功。

安装Python2第三方库numpy,scipy,matplotlib:

sudo pip install numpy
sudo pip install scipy
sudo pip install matplotlib
sudo pip install nose

测试:
python
from numpy import *
import matplotlib.pyplot as plt

相关推荐