前言

最近要使用pillow库, 来训练验证码模型, 但是死活都安装不上

环境

docker中安装, python3

尝试安装

pip install pillow

easy_install Pillow

pipenv install pillow

结果死活就是装不上

报错如下:

  1. Collecting pillow
  2. Using cached https://files.pythonhosted.org/packages/5b/bb/cdc8086db1f15d0664dd22a62c69613cdc00f1dd430b5b19df1bea83f2a3/Pillow-6.2.1.tar.gz
  3. Building wheels for collected packages: pillow
  4. Building wheel for pillow (setup.py) ... error
  5. ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-heq42z9x --python-tag cp37:
  6. ERROR: running bdist_wheel
  7. running build
  8. running build_py
  9. creating build
  10. creating build/lib.linux-x86_64-3.7
  11. creating build/lib.linux-x86_64-3.7/PIL
  12. copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  13. copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
  14. copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  15. copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.7/PIL
  16. copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  17. copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  18. copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  19. copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  20. copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  21. copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  22. copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  23. copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  24. copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  25. copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  26. copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  27. copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  28. copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.7/PIL
  29. copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.7/PIL
  30. copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.7/PIL
  31. copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  32. copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
  33. copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.7/PIL
  34. copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  35. copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.7/PIL
  36. copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.7/PIL
  37. copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  38. copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  39. copying src/PIL/Image.py -> build/lib.linux-x86_64-3.7/PIL
  40. copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.7/PIL
  41. copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.7/PIL
  42. copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  43. copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  44. copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.7/PIL
  45. copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.7/PIL
  46. copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  47. copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  48. copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.7/PIL
  49. copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  50. copying src/PIL/_util.py -> build/lib.linux-x86_64-3.7/PIL
  51. copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.7/PIL
  52. copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  53. copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  54. copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.7/PIL
  55. copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  56. copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.7/PIL
  57. copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.7/PIL
  58. copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.7/PIL
  59. copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  60. copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  61. copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.7/PIL
  62. copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  63. copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.7/PIL
  64. copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  65. copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
  66. copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.7/PIL
  67. copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  68. copying src/PIL/features.py -> build/lib.linux-x86_64-3.7/PIL
  69. copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  70. copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.7/PIL
  71. copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.7/PIL
  72. copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  73. copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  74. copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.7/PIL
  75. copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  76. copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.7/PIL
  77. copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  78. copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.7/PIL
  79. copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.7/PIL
  80. copying src/PIL/_version.py -> build/lib.linux-x86_64-3.7/PIL
  81. copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.7/PIL
  82. copying src/PIL/__main__.py -> build/lib.linux-x86_64-3.7/PIL
  83. copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  84. copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  85. copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  86. copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  87. copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  88. copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  89. copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  90. copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  91. copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.7/PIL
  92. copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.7/PIL
  93. copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  94. copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  95. copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.7/PIL
  96. copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.7/PIL
  97. copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.7/PIL
  98. copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.7/PIL
  99. copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  100. copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.7/PIL
  101. copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.7/PIL
  102. copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  103. copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
  104. running egg_info
  105. writing src/Pillow.egg-info/PKG-INFO
  106. writing dependency_links to src/Pillow.egg-info/dependency_links.txt
  107. writing top-level names to src/Pillow.egg-info/top_level.txt
  108. reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
  109. reading manifest template 'MANIFEST.in'
  110. warning: no files found matching '*.c'
  111. warning: no files found matching '*.h'
  112. warning: no files found matching '*.sh'
  113. warning: no previously-included files found matching '.appveyor.yml'
  114. warning: no previously-included files found matching '.coveragerc'
  115. warning: no previously-included files found matching '.codecov.yml'
  116. warning: no previously-included files found matching '.editorconfig'
  117. warning: no previously-included files found matching '.readthedocs.yml'
  118. warning: no previously-included files found matching 'azure-pipelines.yml'
  119. warning: no previously-included files matching '.git*' found anywhere in distribution
  120. warning: no previously-included files matching '*.pyc' found anywhere in distribution
  121. warning: no previously-included files matching '*.so' found anywhere in distribution
  122. no previously-included directories found matching '.azure-pipelines'
  123. no previously-included directories found matching '.travis'
  124. writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
  125. running build_ext
  126.  
  127. The headers or library files could not be found for jpeg,
  128. a required dependency when compiling Pillow from source.
  129.  
  130. Please see the install instructions at:
  131. https://pillow.readthedocs.io/en/latest/installation.html
  132.  
  133. Traceback (most recent call last):
  134. File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 888, in <module>
  135. zip_safe=not (debug_build() or PLATFORM_MINGW),
  136. File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
  137. return distutils.core.setup(**attrs)
  138. File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
  139. dist.run_commands()
  140. File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
  141. self.run_command(cmd)
  142. File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
  143. cmd_obj.run()
  144. File "/usr/local/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
  145. self.run_command('build')
  146. File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
  147. self.distribution.run_command(command)
  148. File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
  149. cmd_obj.run()
  150. File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
  151. self.run_command(cmd_name)
  152. File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
  153. self.distribution.run_command(command)
  154. File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
  155. cmd_obj.run()
  156. File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 340, in run
  157. self.build_extensions()
  158. File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 687, in build_extensions
  159. raise RequiredDependencyException(f)
  160. __main__.RequiredDependencyException: jpeg
  161.  
  162. During handling of the above exception, another exception occurred:
  163.  
  164. Traceback (most recent call last):
  165. File "<string>", line 1, in <module>
  166. File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 903, in <module>
  167. raise RequiredDependencyException(msg)
  168. __main__.RequiredDependencyException:
  169.  
  170. The headers or library files could not be found for jpeg,
  171. a required dependency when compiling Pillow from source.
  172.  
  173. Please see the install instructions at:
  174. https://pillow.readthedocs.io/en/latest/installation.html
  175.  
  176. ----------------------------------------
  177. ERROR: Failed building wheel for pillow
  178. Running setup.py clean for pillow
  179. Failed to build pillow
  180. Installing collected packages: pillow
  181. Running setup.py install for pillow ... error
  182. ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-3r__g4ou/install-record.txt --single-version-externally-managed --compile:
  183. ERROR: running install
  184. running build
  185. running build_py
  186. creating build
  187. creating build/lib.linux-x86_64-3.7
  188. creating build/lib.linux-x86_64-3.7/PIL
  189. copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  190. copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
  191. copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  192. copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.7/PIL
  193. copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  194. copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  195. copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  196. copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  197. copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  198. copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  199. copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  200. copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  201. copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  202. copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  203. copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  204. copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  205. copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.7/PIL
  206. copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.7/PIL
  207. copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.7/PIL
  208. copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  209. copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
  210. copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.7/PIL
  211. copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  212. copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.7/PIL
  213. copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.7/PIL
  214. copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  215. copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  216. copying src/PIL/Image.py -> build/lib.linux-x86_64-3.7/PIL
  217. copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.7/PIL
  218. copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.7/PIL
  219. copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  220. copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  221. copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.7/PIL
  222. copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.7/PIL
  223. copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  224. copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  225. copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.7/PIL
  226. copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  227. copying src/PIL/_util.py -> build/lib.linux-x86_64-3.7/PIL
  228. copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.7/PIL
  229. copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  230. copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  231. copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.7/PIL
  232. copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  233. copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.7/PIL
  234. copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.7/PIL
  235. copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.7/PIL
  236. copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  237. copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  238. copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.7/PIL
  239. copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  240. copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.7/PIL
  241. copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  242. copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
  243. copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.7/PIL
  244. copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  245. copying src/PIL/features.py -> build/lib.linux-x86_64-3.7/PIL
  246. copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  247. copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.7/PIL
  248. copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.7/PIL
  249. copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  250. copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  251. copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.7/PIL
  252. copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  253. copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.7/PIL
  254. copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  255. copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.7/PIL
  256. copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.7/PIL
  257. copying src/PIL/_version.py -> build/lib.linux-x86_64-3.7/PIL
  258. copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.7/PIL
  259. copying src/PIL/__main__.py -> build/lib.linux-x86_64-3.7/PIL
  260. copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  261. copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  262. copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  263. copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  264. copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  265. copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  266. copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  267. copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  268. copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.7/PIL
  269. copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.7/PIL
  270. copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  271. copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  272. copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.7/PIL
  273. copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.7/PIL
  274. copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.7/PIL
  275. copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.7/PIL
  276. copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  277. copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.7/PIL
  278. copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.7/PIL
  279. copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  280. copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
  281. running egg_info
  282. writing src/Pillow.egg-info/PKG-INFO
  283. writing dependency_links to src/Pillow.egg-info/dependency_links.txt
  284. writing top-level names to src/Pillow.egg-info/top_level.txt
  285. reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
  286. reading manifest template 'MANIFEST.in'
  287. warning: no files found matching '*.c'
  288. warning: no files found matching '*.h'
  289. warning: no files found matching '*.sh'
  290. warning: no previously-included files found matching '.appveyor.yml'
  291. warning: no previously-included files found matching '.coveragerc'
  292. warning: no previously-included files found matching '.codecov.yml'
  293. warning: no previously-included files found matching '.editorconfig'
  294. warning: no previously-included files found matching '.readthedocs.yml'
  295. warning: no previously-included files found matching 'azure-pipelines.yml'
  296. warning: no previously-included files matching '.git*' found anywhere in distribution
  297. warning: no previously-included files matching '*.pyc' found anywhere in distribution
  298. warning: no previously-included files matching '*.so' found anywhere in distribution
  299. no previously-included directories found matching '.azure-pipelines'
  300. no previously-included directories found matching '.travis'
  301. writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
  302. running build_ext
  303.  
  304. The headers or library files could not be found for jpeg,
  305. a required dependency when compiling Pillow from source.
  306.  
  307. Please see the install instructions at:
  308. https://pillow.readthedocs.io/en/latest/installation.html
  309.  
  310. Traceback (most recent call last):
  311. File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 888, in <module>
  312. zip_safe=not (debug_build() or PLATFORM_MINGW),
  313. File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
  314. return distutils.core.setup(**attrs)
  315. File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
  316. dist.run_commands()
  317. File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
  318. self.run_command(cmd)
  319. File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
  320. cmd_obj.run()
  321. File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
  322. return orig.install.run(self)
  323. File "/usr/local/lib/python3.7/distutils/command/install.py", line 545, in run
  324. self.run_command('build')
  325. File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
  326. self.distribution.run_command(command)
  327. File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
  328. cmd_obj.run()
  329. File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
  330. self.run_command(cmd_name)
  331. File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
  332. self.distribution.run_command(command)
  333. File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
  334. cmd_obj.run()
  335. File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 340, in run
  336. self.build_extensions()
  337. File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 687, in build_extensions
  338. raise RequiredDependencyException(f)
  339. __main__.RequiredDependencyException: jpeg
  340.  
  341. During handling of the above exception, another exception occurred:
  342.  
  343. Traceback (most recent call last):
  344. File "<string>", line 1, in <module>
  345. File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 903, in <module>
  346. raise RequiredDependencyException(msg)
  347. __main__.RequiredDependencyException:
  348.  
  349. The headers or library files could not be found for jpeg,
  350. a required dependency when compiling Pillow from source.
  351.  
  352. Please see the install instructions at:
  353. https://pillow.readthedocs.io/en/latest/installation.html
  354.  
  355. ----------------------------------------
  356. ERROR: Command "/usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-3r__g4ou/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-1vq2qpq_/pillow/

解决中......

在网上苦苦搜寻, 终于在stackoverflow找到了答案, 原来是缺少依赖包

https://stackoverflow.com/questions/44043906/the-headers-or-library-files-could-not-be-found-for-jpeg-installing-pillow-on/44044479#44044479

解决方法

在build Dockerfile文件中加入以下内容:

  1. FROM python:alpine
  2. RUN apk --update add libxml2-dev libxslt-dev libffi-dev gcc musl-dev libgcc openssl-dev curl
  3. RUN apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev
  4. RUN pip install Pillow

这样就可以build成功了

可以进入到容器中

直接安装这几个依赖, 然后就直接可以在容器中安装了, 不用在重新build镜像了

  1. apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev

补充

好了, 就可以愉快的使用了, 其他有可能是权限报错, 或者 切换下安装源

python3 安装 pillow报错的更多相关文章

  1. 安装pillow报错处理

    sudo python3 pip install pillow 报错:The headers or library files could not be found for jpeg,... 解决:安 ...

  2. Windows下Python中pip安装Pillow报错总结(转载)

    遇到的俩种错误1.ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting 问题原因 ...

  3. CentOS7.5 Python3安装pip报错:ModuleNotFoundError: No module named '_ctypes' --Python3

    1.问题:pyhontModuleNotFoundError: No module named '_ctypes'  操作系统:CentOS7.5 安装完Pyhotn3后(如何安装Python3,安装 ...

  4. 在centos6.7通过源码安装python3.6.7报错“zipimport.ZipImportError: can't decompress data; zlib not available”

    在centos6.7通过源码安装python3.6.7报错: zipimport.ZipImportError: can't decompress data; zlib not available 从 ...

  5. python27(32位)安装模块报错“error: Unable to find vcvarsall.bat”

    1)首先,下载一个Microsoft Visual C++ Compiler for Python 2.7的补丁,下载地址在这里: http://www.microsoft.com/en-us/dow ...

  6. python︱模块加载(pip安装)以及pycharm安装与报错解决方式

    每每以为攀得众山小,可.每每又切实来到起点,大牛们,缓缓脚步来俺笔记葩分享一下吧,please~ --------------------------- 准备放下R开始学python,真是痛苦,因为找 ...

  7. pip安装pycrypto报错:Microsoft Visual C++ 14.0 is required. 和 SSLError: HTTPSConnectionPool的解决办法

    今天本打算把[Python3爬虫]网易云音乐爬虫 的代码敲一遍, 但是在安装pycrypto老是报错, 由于我计算是win10, 并且也有vs2017 python3环境下安装pycrypto的一些问 ...

  8. Python3 pip命令报错:Fatal error in launcher: Unable to create process using '"'

    Python3 pip命令报错:Fatal error in launcher: Unable to create process using '"' 一.问题 环境:win7 同时安装py ...

  9. mac下安装mysqlcient 报错

    一.我在mac下pip3安装mysqlclient 报错: pip3 install mysqlclient Collecting mysqlclient Using cached mysqlclie ...

随机推荐

  1. 『2019Summer Algorithms』

    一个暑假两次集训,感觉学了好多好多的东西,也挖了好多好多的坑,于是就决定写一篇关于算法的总结,用于熟悉新算法,也留下一点对新算法的理解. AC自动机 简单的说就是在\(trie\)树上实现\(KMP\ ...

  2. spring cloud应用

    1.什么是注册中心 (1)就是首先有一个eureka server,服务的注册与发现的中心(2)你如果写好了一个服务,就可以将其注册到eureka server上去(3)然后别人的服务如果要调用你的服 ...

  3. 示例:WPF中自定义MessageService应用DialogHost、Snackbar、NotifyIcon显示各种场景提示消息

    原文:示例:WPF中自定义MessageService应用DialogHost.Snackbar.NotifyIcon显示各种场景提示消息 一.目的:不同交互场景需要提示不同的消息,不同的消息需要用不 ...

  4. oracle 根据字段分组取第一条数据及rank函数说明

    当前有这样一个需求,根据外键对子表数据进行分组,取每组中的一条数据就行了,如图: 如:COMMANDID = 26的有两条,只取一条数据. sql语句: select * from(select SY ...

  5. 关于visual studio 2015 智能提示英文,而非中文的解决方案

    关于visual studio 2015 智能提示英文,而非中文的解决方案:   找到这个目录 C:\Program Files (x86)\Reference Assemblies\Microsof ...

  6. Asp.Net 技术

    Asp.Net 技术Nuget 管理器Spring.NET 框架Spring.core 包 微服务Consul .NetCore 框架:Spring.net Nhibernate 框架Dapper.n ...

  7. POI SXSSF API 导出1000万数据示例

    SXSSF是XSSF API的兼容流式扩展,在必须生成非常大的电子表格.并且堆空间有限时使用. SXSSF通过限制对滑动窗口内数据的访问实现低内存占用,而XSSF允许访问文档中的所有行. 不在窗口中的 ...

  8. windows环境:dos 通过ftp连接到vsftpd 显示乱码解决方法

    转载至:https://blog.csdn.net/nydia_xiangxiang/article/details/48627921?utm_source=blogxgwz8 感谢原作者的分享 FT ...

  9. w3c网站案例

    w3c网站 reset操作 body { background-color: #eee; } html, body, h1, h2, h3, h4, h5, h6, ul, p { margin: 0 ...

  10. react,react-router,redux+react-redux 构建一个React Demo

    创建初始化应用 加速我们的npm. npm install -g cnpm --registry=https://registry.npm.taobao.org 利用create-react-app ...