python3.5 pillow 3.6 安装Pillow出现error

21:37 提问
Centos6.3安装python3的Pillow报错
python3.3.0
Pillow2.1.0(在python2.x中PIL,他们是图象处理第三方库)
Pillow目录内容:
[root@centos Pillow-2.1.0]# ll
drwxr-xr-x. 4 root root
4096 Mar 23 20:56 build
-rw-r--r--. 1 root root
2013 decode.c
-rw-r--r--. 1 root root
22044 Jun 30
2013 display.c
drwxr-xr-x. 2 root root
4096 Mar 23 20:55 docs
-rw-r--r--. 1 root root
2013 encode.c
drwxr-xr-x. 2 root root
4096 Mar 23 20:55 Images
-rw-r--r--. 1 root root
2013 _imaging.c
-rw-r--r--. 1 root root
19942 Jun 30
2013 _imagingcms.c
-rw-r--r--. 1 root root
15845 Jun 30
2013 _imagingft.c
-rw-r--r--. 1 root root
7265 Jun 30
2013 _imagingmath.c
-rw-r--r--. 1 root root
1834 Jun 30
2013 _imagingtk.c
drwxr-xr-x. 2 root root
4096 Mar 23 20:55 libImaging
-rw-r--r--. 1 root root
2013 MANIFEST.in
-rw-r--r--. 1 root root
9865 Jun 30
2013 map.c
-rw-r--r--. 1 root root
4722 Jun 30
2013 outline.c
-rw-r--r--. 1 root root
16171 Jun 30
2013 path.c
drwxr-xr-x. 2 root root
4096 Mar 23 20:55 PIL
drwxr-xr-x. 2 root root
4096 Mar 23 20:55 Pillow.egg-info
-rw-r--r--. 1 root root 117623 Jul
2013 PKG-INFO
-rw-r--r--. 1 root root
2067 Jun 30
2013 py3.h
-rw-r--r--. 1 root root
2013 README.rst
drwxr-xr-x. 2 root root
4096 Mar 23 20:55 Sane
drwxr-xr-x. 2 root root
4096 Mar 23 20:55 Scripts
-rw-r--r--. 1 root root
6175 Jun 30
2013 selftest.py
-rw-r--r--. 1 root root
2013 setup.cfg
-rw-r--r--. 1 root root
2013 setup.py
drwxr-xr-x. 5 root root
4096 Mar 23 20:55 Tests
drwxr-xr-x. 2 root root
4096 Mar 23 20:55 Tk
-rw-r--r--. 1 root root
373 Jun 30
2013 tox.ini
-rw-r--r--. 1 root root
4262 Jun 30
2013 _webp.c
安装报错(这里贴的代码是测试安装报错的代码,因为正式安装代码太多、太杂了):
[root@centos Pillow-2.1.0]# python setup.py build_ext -i running build_ext
**error: in 'ext_modules' option (extension 'PIL._imaging'), 'sources' must be present and must be a list of source filenames**
求大神帮助
按赞数排序
看一下你的ext_modules参数是怎么设置的
@oyljerry 你好,以下是我的参数
name=NAME,
version=VERSION,
description='Python Imaging Library (fork)',
long_description=(
_read('README.rst') + b'\n' +
_read('docs/HISTORY.txt') + b'\n' +
_read('docs/CONTRIBUTORS.txt')).decode('utf-8'),
author='Alex Clark (fork author)',
author_email='',
url='http://python-imaging.github.io/',
classifiers=[
"Development Status :: 6 - Mature",
"Topic :: Multimedia :: Graphics",
"Topic :: Multimedia :: Graphics :: Capture :: Digital Camera",
"Topic :: Multimedia :: Graphics :: Capture :: Scanners",
"Topic :: Multimedia :: Graphics :: Capture :: Screen Capture",
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
"Topic :: Multimedia :: Graphics :: Viewers",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3", ],
cmdclass={"build_ext": pil_build_ext},
ext_modules=[Extension("PIL._imaging", ["_imaging.c"])],
packages=find_packages(),
scripts=glob.glob("Scripts/pil*.py"),
keywords=["Imaging",],
license='Standard PIL License',
zip_safe=True,
@oyljerry 你好,以下是我的参数
name=NAME,
version=VERSION,
description='Python Imaging Library (fork)',
long_description=(
_read('README.rst') + b'\n' +
_read('docs/HISTORY.txt') + b'\n' +
_read('docs/CONTRIBUTORS.txt')).decode('utf-8'),
author='Alex Clark (fork author)',
author_email='',
url='http://python-imaging.github.io/',
classifiers=[
"Development Status :: 6 - Mature",
"Topic :: Multimedia :: Graphics",
"Topic :: Multimedia :: Graphics :: Capture :: Digital Camera",
"Topic :: Multimedia :: Graphics :: Capture :: Scanners",
"Topic :: Multimedia :: Graphics :: Capture :: Screen Capture",
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
"Topic :: Multimedia :: Graphics :: Viewers",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3", ],
cmdclass={"build_ext": pil_build_ext},
ext_modules=[Extension("PIL._imaging", ["_imaging.c"])],
packages=find_packages(),
scripts=glob.glob("Scripts/pil*.py"),
keywords=["Imaging",],
license='Standard PIL License',
zip_safe=True,
我看了一下他的代码,其中这句是关键:
ext_modules=[Extension("PIL._imaging", ["_imaging.c"])]
之后我在PIL目录中没有发现 _imaging 这个模块(文件),这个包可是我从官网下载下来的,不知道怎么会错请求帮助
11829关注|1001收录
其他相似问题&&&&Python 的PIL,可以解决ImportError The _imagingft C module is not installed
Python 的PIL,可以解决ImportError The _imagingft C module is not installed
只要用PIL1.1.7生成验证码,导入字库的时候都会遇到闻名天下的ImportError The _imagingft C module is not installed错误,我翻墙,查了很多资料,其实就是却一个freetype的库,但是我不知道怎么补上,最后,找到这么一个安装包,包含了freetype库的,不知道编译者是谁,只能在此无限感激此恩人。win7 32位操作系统测试通过,64位请绕道,用pillow。
若举报审核通过,可奖励20下载分
被举报人:
举报的资源分:
请选择类型
资源无法下载
资源无法使用
标题与实际内容不符
含有危害国家安全内容
含有反动色情等内容
含广告内容
版权问题,侵犯个人或公司的版权
*详细原因:
VIP下载&&免积分60元/年(1200次)
您可能还需要
开发技术下载排行python - Python3.5 - pip install error: Unable to find vcvarsall.bat - Stack Overflow
to customize your list.
Announcing Stack Overflow Documentation
We started with Q&A. Technical documentation is next, and we need your help.
Whether you're a beginner or an experienced developer, you can contribute.
Python v3.5,
Windows 7 64-bit,
IDE: PyCharm Version: 4.5.4 Build: 141.2569
Situation:
When trying to install a module called PyAutoGUI with pip I came across a "Unable to find vcvarsall.bat" error. Trying to install from the command prompt ends up giving the same error. Although the error seems to be quite commonplace, with the solution being downloading the module from , I did not find the module I was looking for there.
Any advice would be greatly appreciated.
Collecting PyAutoGUI
Downloading PyAutoGUI-0.9.31.zip (55kB)
Collecting pymsgbox (from PyAutoGUI)
Downloading PyMsgBox-1.0.3.zip
Collecting PyTweening&=1.0.1 (from PyAutoGUI)
Downloading PyTweening-1.0.2.zip
Collecting Pillow (from PyAutoGUI)
Downloading Pillow-2.9.0.tar.gz (9.3MB)
Collecting pyscreeze (from PyAutoGUI)
Downloading PyScreeze-0.1.7.zip
Installing collected packages: pymsgbox, PyTweening, Pillow, pyscreeze, PyAutoGUI
Running setup.py install for pymsgbox
Running setup.py install for PyTweening
Running setup.py install for Pillow
Complete output from command C:\Users\Marx\AppData\Local\Programs\Python\Python35-32\python.exe -c "import setuptools,__file__='C:\\Users\\Marx\\AppData\\Local\\Temp\\pycharm-packaging0.tmp\\Pillow\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Marx\AppData\Local\Temp\pip-iwse_fey-record\install-record.txt --single-version-externally-managed --compile:
Single threaded build, not installing mp_compile: 4 processes
running install
running build
running build_py
creating build
creating build\lib.win32-3.5
creating build\lib.win32-3.5\PIL
copying PIL\BdfFontFile.py -& build\lib.win32-3.5\PIL
copying PIL\BmpImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\BufrStubImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\ContainerIO.py -& build\lib.win32-3.5\PIL
copying PIL\CurImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\DcxImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\EpsImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\ExifTags.py -& build\lib.win32-3.5\PIL
copying PIL\features.py -& build\lib.win32-3.5\PIL
copying PIL\FitsStubImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\FliImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\FontFile.py -& build\lib.win32-3.5\PIL
copying PIL\FpxImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\GbrImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\GdImageFile.py -& build\lib.win32-3.5\PIL
copying PIL\GifImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\GimpGradientFile.py -& build\lib.win32-3.5\PIL
copying PIL\GimpPaletteFile.py -& build\lib.win32-3.5\PIL
copying PIL\GribStubImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\Hdf5StubImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\IcnsImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\IcoImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\Image.py -& build\lib.win32-3.5\PIL
copying PIL\ImageChops.py -& build\lib.win32-3.5\PIL
copying PIL\ImageCms.py -& build\lib.win32-3.5\PIL
copying PIL\ImageColor.py -& build\lib.win32-3.5\PIL
copying PIL\ImageDraw.py -& build\lib.win32-3.5\PIL
copying PIL\ImageDraw2.py -& build\lib.win32-3.5\PIL
copying PIL\ImageEnhance.py -& build\lib.win32-3.5\PIL
copying PIL\ImageFile.py -& build\lib.win32-3.5\PIL
copying PIL\ImageFileIO.py -& build\lib.win32-3.5\PIL
copying PIL\ImageFilter.py -& build\lib.win32-3.5\PIL
copying PIL\ImageFont.py -& build\lib.win32-3.5\PIL
copying PIL\ImageGrab.py -& build\lib.win32-3.5\PIL
copying PIL\ImageMath.py -& build\lib.win32-3.5\PIL
copying PIL\ImageMode.py -& build\lib.win32-3.5\PIL
copying PIL\ImageMorph.py -& build\lib.win32-3.5\PIL
copying PIL\ImageOps.py -& build\lib.win32-3.5\PIL
copying PIL\ImagePalette.py -& build\lib.win32-3.5\PIL
copying PIL\ImagePath.py -& build\lib.win32-3.5\PIL
copying PIL\ImageQt.py -& build\lib.win32-3.5\PIL
copying PIL\ImageSequence.py -& build\lib.win32-3.5\PIL
copying PIL\ImageShow.py -& build\lib.win32-3.5\PIL
copying PIL\ImageStat.py -& build\lib.win32-3.5\PIL
copying PIL\ImageTk.py -& build\lib.win32-3.5\PIL
copying PIL\ImageTransform.py -& build\lib.win32-3.5\PIL
copying PIL\ImageWin.py -& build\lib.win32-3.5\PIL
copying PIL\ImImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\ImtImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\IptcImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\Jpeg2KImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\JpegImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\JpegPresets.py -& build\lib.win32-3.5\PIL
copying PIL\McIdasImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\MicImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\MpegImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\MpoImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\MspImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\OleFileIO.py -& build\lib.win32-3.5\PIL
copying PIL\PaletteFile.py -& build\lib.win32-3.5\PIL
copying PIL\PalmImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\PcdImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\PcfFontFile.py -& build\lib.win32-3.5\PIL
copying PIL\PcxImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\PdfImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\PixarImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\PngImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\PpmImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\PsdImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\PSDraw.py -& build\lib.win32-3.5\PIL
copying PIL\PyAccess.py -& build\lib.win32-3.5\PIL
copying PIL\SgiImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\SpiderImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\SunImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\TarIO.py -& build\lib.win32-3.5\PIL
copying PIL\TgaImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\TiffImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\TiffTags.py -& build\lib.win32-3.5\PIL
copying PIL\WalImageFile.py -& build\lib.win32-3.5\PIL
copying PIL\WebPImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\WmfImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\XbmImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\XpmImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\XVThumbImagePlugin.py -& build\lib.win32-3.5\PIL
copying PIL\_binary.py -& build\lib.win32-3.5\PIL
copying PIL\_util.py -& build\lib.win32-3.5\PIL
copying PIL\__init__.py -& build\lib.win32-3.5\PIL
running egg_info
writing top-level names to Pillow.egg-info\top_level.txt
writing dependency_links to Pillow.egg-info\dependency_links.txt
writing Pillow.egg-info\PKG-INFO
warning: manifest_maker: standard file '-c' not found
reading manifest file 'Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Pillow.egg-info\SOURCES.txt'
copying PIL\OleFileIO-README.md -& build\lib.win32-3.5\PIL
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'PIL._imaging' extension
error: Unable to find vcvarsall.bat
----------------------------------------
If you read your error message carefully, you can see that the error actually occurs when trying to install pillow.
pillow does have a version available on Gohlke's website that you linked to.
So try installing pillow from there, then do your pip install pyautogui and see if it works.
Some Python packages have parts that are written in C.
To use these, you either need a C compiler or you need a Windows installer for the package (like those provided on Gohlke's site).
It appears that PyAutoGUI does not require compilation, but it requires Pillow, which does require compilation.
So you may be able to get it to work by installing Pillow separately.
(You may get the error message again because the same problem may exist for another dependency, so you may have to repeat this process, installing other libs until you have enough installed that pip will work.)
108k11161198
I ran into similar problem with packages like cx_Oracle and pysftp. This is what worked for me:
Install an appropriate version of c++ compiler. I am using the following Python interpreter, Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 :59) [MSC v.1900 32 bit (Intel)] on win32. I installed Visual Studio 2015 Community Edition. (thanks to @Colonel Panic)
Rerun the pip for your target package.
Happy coding!!
Reference:
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
The week's top questions and answers
Important community announcements
Questions that need answers
By subscribing, you agree to the
Stack Overflow works best with JavaScript enabled

我要回帖

更多关于 python3 pillow 的文章

 

随机推荐