环境:
python3.3.0
Pillow2.1.0(在python2.x中PIL,他们是图象处理第三方库)
Pillow目录内容:
[root@centos Pillow-2.1.0]# ll
total 484
drwxr-xr-x. 4 root root 4096 Mar 23 20:56 build
-rw-r--r--. 1 root root 21748 Jul 1 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 23104 Jul 1 2013 encode.c
drwxr-xr-x. 2 root root 4096 Mar 23 20:55 Images
-rw-r--r--. 1 root root 93014 Jul 1 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 570 Jul 2 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 2 2013 PKG-INFO
-rw-r--r--. 1 root root 2067 Jun 30 2013 py3.h
-rw-r--r--. 1 root root 21541 Jul 1 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 59 Jul 2 2013 setup.cfg
-rw-r--r--. 1 root root 21161 Jul 1 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 你好,以下是我的参数
setup(
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='aclark@aclark.net',
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
我看了一下他的代码,其中这句是关键:
ext_modules=[Extension("PIL._imaging", ["_imaging.c"])]
之后我在PIL目录中没有发现 _imaging 这个模块(文件),这个包可是我从官网下载下来的,不知道怎么会错请求帮助