Python 3.x 为什么我得到一个'modulenofounderror:No module name';图像';`错误?
当我运行Python脚本时,我得到以下消息:Python 3.x 为什么我得到一个'modulenofounderror:No module name';图像';`错误?,python-3.x,linux,ubuntu,importerror,Python 3.x,Linux,Ubuntu,Importerror,当我运行Python脚本时,我得到以下消息: ModuleNotFoundError: No module named 'Image' 我正在Linux Ubuntu上运行Python 3.6。 名为Fax_simulator的脚本包含: import Image # other code… 它位于: /home/CVS/facsim/venv 我搜索了模块,找到了: /usr/lib/python3/dist-packages/PIL/Image.py 下面是一些代码行: import
ModuleNotFoundError: No module named 'Image'
我正在Linux Ubuntu上运行Python 3.6。
名为Fax_simulator的脚本包含:
import Image
# other code…
它位于:
/home/CVS/facsim/venv
我搜索了模块,找到了:
/usr/lib/python3/dist-packages/PIL/Image.py
下面是一些代码行:
import Image
import ImageDraw
import ImageFont
我必须安装它吗。如果是,怎么做?和皮普?我从Python3.6获得了PIP版本9.0.1。可以吗?您需要从
PIL
软件包导入它们:
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
# use Image
或者:
import PIL
# use PIL.Image
Image
是PIL
的子模块。它的完全限定名是PIL.Image
。