mac os 使用 from scipy.misc import imread ImportError: cannot import name 'imread'

问题1:

我原先安装了 pillow 仍然会报错,我看了一下 pillow 的版本,默认安装 Pillow==6.0.0 这个版本的 scipy.misc 里面没有 imread

  1. pip3 install Pillow==4.3.0

问题2:

安装Pillow==4.3.0错误:

  1. Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
  2. Collecting Pillow==3.3.1
  3. Downloading https://mirrors.aliyun.com/pypi/packages/7b/32/e6978aed8fba6398c00eec25f12798fb57647a6cef4f85db1567e3d086ef/Pillow-3.3.1.tar.gz (10.6MB)
  4. |████████████████████████████████| 10.6MB 7.5MB/s
  5. Building wheels for collected packages: Pillow
  6. Building wheel for Pillow (setup.py) ... error
  7. ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-install-6rx_ulqm/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 /private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-wheel-37mrjey0 --python-tag cp37:
  8. ERROR: running bdist_wheel
  9. running build
  10. running build_py
  11. creating build
  12. creating build/lib.macosx-10.9-x86_64-3.7
  13. creating build/lib.macosx-10.9-x86_64-3.7/PIL
  14. copying PIL/MpoImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  15. copying PIL/ImageMode.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  16. copying PIL/PngImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  17. copying PIL/XbmImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  18. copying PIL/PcxImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  19. copying PIL/SunImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  20. copying PIL/ImageFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  21. copying PIL/SpiderImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  22. copying PIL/TarIO.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  23. copying PIL/FitsStubImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  24. copying PIL/MpegImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  25. copying PIL/BdfFontFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  26. copying PIL/GribStubImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  27. copying PIL/ImageStat.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  28. copying PIL/PixarImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  29. copying PIL/GimpPaletteFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  30. copying PIL/ImageColor.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  31. copying PIL/ContainerIO.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  32. copying PIL/MspImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  33. copying PIL/MicImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  34. copying PIL/ImtImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  35. copying PIL/GifImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  36. copying PIL/PalmImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  37. copying PIL/ImageQt.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  38. copying PIL/ImageMath.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  39. copying PIL/PaletteFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  40. copying PIL/FontFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  41. copying PIL/ExifTags.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  42. copying PIL/ImageCms.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  43. copying PIL/FpxImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  44. copying PIL/ImageChops.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  45. copying PIL/BufrStubImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  46. copying PIL/PSDraw.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  47. copying PIL/PcdImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  48. copying PIL/ImageFilter.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  49. copying PIL/ImageDraw2.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  50. copying PIL/ImagePath.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  51. copying PIL/DcxImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  52. copying PIL/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  53. copying PIL/JpegPresets.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  54. copying PIL/Hdf5StubImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  55. copying PIL/features.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  56. copying PIL/ImageDraw.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  57. copying PIL/GimpGradientFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  58. copying PIL/ImageWin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  59. copying PIL/IcoImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  60. copying PIL/_tkinter_finder.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  61. copying PIL/EpsImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  62. copying PIL/TgaImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  63. copying PIL/ImageMorph.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  64. copying PIL/Jpeg2KImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  65. copying PIL/WalImageFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  66. copying PIL/PcfFontFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  67. copying PIL/ImageTk.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  68. copying PIL/GbrImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  69. copying PIL/ImageOps.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  70. copying PIL/PdfImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  71. copying PIL/ImageShow.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  72. copying PIL/ImageEnhance.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  73. copying PIL/WmfImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  74. copying PIL/ImageGrab.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  75. copying PIL/WebPImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  76. copying PIL/FliImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  77. copying PIL/TiffTags.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  78. copying PIL/CurImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  79. copying PIL/_util.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  80. copying PIL/GdImageFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  81. copying PIL/TiffImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  82. copying PIL/IptcImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  83. copying PIL/ImagePalette.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  84. copying PIL/BmpImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  85. copying PIL/ImageTransform.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  86. copying PIL/IcnsImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  87. copying PIL/McIdasImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  88. copying PIL/XpmImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  89. copying PIL/OleFileIO.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  90. copying PIL/DdsImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  91. copying PIL/ImageSequence.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  92. copying PIL/PyAccess.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  93. copying PIL/_binary.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  94. copying PIL/Image.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  95. copying PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  96. copying PIL/SgiImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  97. copying PIL/ImImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  98. copying PIL/PsdImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  99. copying PIL/JpegImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  100. copying PIL/ImageFont.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  101. copying PIL/PpmImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  102. copying PIL/FtexImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  103. running egg_info
  104. writing Pillow.egg-info/PKG-INFO
  105. writing dependency_links to Pillow.egg-info/dependency_links.txt
  106. writing top-level names to Pillow.egg-info/top_level.txt
  107. reading manifest file 'Pillow.egg-info/SOURCES.txt'
  108. reading manifest template 'MANIFEST.in'
  109. warning: no files found matching '*.sh'
  110. no previously-included directories found matching 'docs/_static'
  111. warning: no previously-included files found matching '.coveragerc'
  112. warning: no previously-included files found matching '.editorconfig'
  113. warning: no previously-included files found matching '.landscape.yaml'
  114. warning: no previously-included files found matching 'appveyor.yml'
  115. warning: no previously-included files found matching 'build_children.sh'
  116. warning: no previously-included files found matching 'tox.ini'
  117. warning: no previously-included files matching '.git*' found anywhere in distribution
  118. warning: no previously-included files matching '*.pyc' found anywhere in distribution
  119. warning: no previously-included files matching '*.so' found anywhere in distribution
  120. writing manifest file 'Pillow.egg-info/SOURCES.txt'
  121. copying PIL/OleFileIO-README.md -> build/lib.macosx-10.9-x86_64-3.7/PIL
  122. running build_ext
  123. Traceback (most recent call last):
  124. File "<string>", line 1, in <module>
  125. File "/private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-install-6rx_ulqm/Pillow/setup.py", line 753, in <module>
  126. zip_safe=not debug_build(), )
  127. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
  128. return distutils.core.setup(**attrs)
  129. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
  130. dist.run_commands()
  131. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
  132. self.run_command(cmd)
  133. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
  134. cmd_obj.run()
  135. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
  136. self.run_command('build')
  137. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
  138. self.distribution.run_command(command)
  139. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
  140. cmd_obj.run()
  141. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build.py", line 135, in run
  142. self.run_command(cmd_name)
  143. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
  144. self.distribution.run_command(command)
  145. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
  146. cmd_obj.run()
  147. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build_ext.py", line 340, in run
  148. self.build_extensions()
  149. File "/private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-install-6rx_ulqm/Pillow/setup.py", line 521, in build_extensions
  150. ' using --disable-%s, aborting' % (f, f))
  151. ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting
  152. ----------------------------------------
  153. ERROR: Failed building wheel for Pillow
  154. Running setup.py clean for Pillow
  155. Failed to build Pillow
  156. Installing collected packages: Pillow
  157. Running setup.py install for Pillow ... error
  158. ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-install-6rx_ulqm/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 /private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-record-l9wo3iyw/install-record.txt --single-version-externally-managed --compile:
  159. ERROR: running install
  160. running build
  161. running build_py
  162. creating build
  163. creating build/lib.macosx-10.9-x86_64-3.7
  164. creating build/lib.macosx-10.9-x86_64-3.7/PIL
  165. copying PIL/MpoImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  166. copying PIL/ImageMode.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  167. copying PIL/PngImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  168. copying PIL/XbmImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  169. copying PIL/PcxImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  170. copying PIL/SunImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  171. copying PIL/ImageFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  172. copying PIL/SpiderImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  173. copying PIL/TarIO.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  174. copying PIL/FitsStubImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  175. copying PIL/MpegImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  176. copying PIL/BdfFontFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  177. copying PIL/GribStubImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  178. copying PIL/ImageStat.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  179. copying PIL/PixarImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  180. copying PIL/GimpPaletteFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  181. copying PIL/ImageColor.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  182. copying PIL/ContainerIO.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  183. copying PIL/MspImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  184. copying PIL/MicImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  185. copying PIL/ImtImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  186. copying PIL/GifImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  187. copying PIL/PalmImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  188. copying PIL/ImageQt.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  189. copying PIL/ImageMath.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  190. copying PIL/PaletteFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  191. copying PIL/FontFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  192. copying PIL/ExifTags.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  193. copying PIL/ImageCms.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  194. copying PIL/FpxImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  195. copying PIL/ImageChops.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  196. copying PIL/BufrStubImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  197. copying PIL/PSDraw.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  198. copying PIL/PcdImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  199. copying PIL/ImageFilter.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  200. copying PIL/ImageDraw2.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  201. copying PIL/ImagePath.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  202. copying PIL/DcxImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  203. copying PIL/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  204. copying PIL/JpegPresets.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  205. copying PIL/Hdf5StubImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  206. copying PIL/features.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  207. copying PIL/ImageDraw.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  208. copying PIL/GimpGradientFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  209. copying PIL/ImageWin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  210. copying PIL/IcoImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  211. copying PIL/_tkinter_finder.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  212. copying PIL/EpsImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  213. copying PIL/TgaImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  214. copying PIL/ImageMorph.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  215. copying PIL/Jpeg2KImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  216. copying PIL/WalImageFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  217. copying PIL/PcfFontFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  218. copying PIL/ImageTk.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  219. copying PIL/GbrImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  220. copying PIL/ImageOps.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  221. copying PIL/PdfImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  222. copying PIL/ImageShow.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  223. copying PIL/ImageEnhance.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  224. copying PIL/WmfImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  225. copying PIL/ImageGrab.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  226. copying PIL/WebPImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  227. copying PIL/FliImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  228. copying PIL/TiffTags.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  229. copying PIL/CurImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  230. copying PIL/_util.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  231. copying PIL/GdImageFile.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  232. copying PIL/TiffImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  233. copying PIL/IptcImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  234. copying PIL/ImagePalette.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  235. copying PIL/BmpImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  236. copying PIL/ImageTransform.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  237. copying PIL/IcnsImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  238. copying PIL/McIdasImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  239. copying PIL/XpmImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  240. copying PIL/OleFileIO.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  241. copying PIL/DdsImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  242. copying PIL/ImageSequence.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  243. copying PIL/PyAccess.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  244. copying PIL/_binary.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  245. copying PIL/Image.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  246. copying PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  247. copying PIL/SgiImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  248. copying PIL/ImImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  249. copying PIL/PsdImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  250. copying PIL/JpegImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  251. copying PIL/ImageFont.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  252. copying PIL/PpmImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  253. copying PIL/FtexImagePlugin.py -> build/lib.macosx-10.9-x86_64-3.7/PIL
  254. running egg_info
  255. writing Pillow.egg-info/PKG-INFO
  256. writing dependency_links to Pillow.egg-info/dependency_links.txt
  257. writing top-level names to Pillow.egg-info/top_level.txt
  258. reading manifest file 'Pillow.egg-info/SOURCES.txt'
  259. reading manifest template 'MANIFEST.in'
  260. warning: no files found matching '*.sh'
  261. no previously-included directories found matching 'docs/_static'
  262. warning: no previously-included files found matching '.coveragerc'
  263. warning: no previously-included files found matching '.editorconfig'
  264. warning: no previously-included files found matching '.landscape.yaml'
  265. warning: no previously-included files found matching 'appveyor.yml'
  266. warning: no previously-included files found matching 'build_children.sh'
  267. warning: no previously-included files found matching 'tox.ini'
  268. warning: no previously-included files matching '.git*' found anywhere in distribution
  269. warning: no previously-included files matching '*.pyc' found anywhere in distribution
  270. warning: no previously-included files matching '*.so' found anywhere in distribution
  271. writing manifest file 'Pillow.egg-info/SOURCES.txt'
  272. copying PIL/OleFileIO-README.md -> build/lib.macosx-10.9-x86_64-3.7/PIL
  273. running build_ext
  274. Traceback (most recent call last):
  275. File "<string>", line 1, in <module>
  276. File "/private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-install-6rx_ulqm/Pillow/setup.py", line 753, in <module>
  277. zip_safe=not debug_build(), )
  278. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
  279. return distutils.core.setup(**attrs)
  280. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
  281. dist.run_commands()
  282. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
  283. self.run_command(cmd)
  284. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
  285. cmd_obj.run()
  286. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
  287. return orig.install.run(self)
  288. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 545, in run
  289. self.run_command('build')
  290. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
  291. self.distribution.run_command(command)
  292. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
  293. cmd_obj.run()
  294. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build.py", line 135, in run
  295. self.run_command(cmd_name)
  296. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
  297. self.distribution.run_command(command)
  298. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
  299. cmd_obj.run()
  300. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build_ext.py", line 340, in run
  301. self.build_extensions()
  302. File "/private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-install-6rx_ulqm/Pillow/setup.py", line 521, in build_extensions
  303. ' using --disable-%s, aborting' % (f, f))
  304. ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting
  305. ----------------------------------------
  306. ERROR: Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-install-6rx_ulqm/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 /private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-record-l9wo3iyw/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-install-6rx_ulqm/Pillow/

  最后一行红色是重点:

Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-install-6rx_ulqm/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 /private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-record-l9wo3iyw/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/zy/fjrb7rqn1vd88h7fs111k3j00000gn/T/pip-install-6rx_ulqm/Pillow/

原因及解决办法:

  1. ###### 解决办法:
  2. ###### 这是因为缺少openjpeg这个库的问题,可以使用安装:
  3. > brew install openjpeg
  1. > pip3 install Pillow==5.2.0
  1. 问题3:发现还是没有 cannot import name 'imread'
    解决:
    3.1查看pillowscipy安装目录是否一致,不一致卸载
    sudo pip3 install pillow
    sudo pip install scipy
    3.2 重新安装


sudo pip install scipy==1.1.0

sudo pip3 install pillow==5.2.0

  3.3测试

python3 -c "from scipy.misc import imread "

  1.  

mac os 使用 from scipy.misc import imread ImportError: cannot import name 'imread'的更多相关文章

  1. ubuntu16 升级pip3后报错File "/usr/bin/pip3", line 9, in <module> from pip import main ImportError: cannot import name 'main'

    问题:ubuntu16 执行pip3 install --upgrade pip之后,pip3执行出错. Traceback (most recent call last): File "/ ...

  2. 输入pip命令报错:from pip import main ImportError: cannot import name 'main'

    报错信息: qly@qlyComputer:~$ pip Traceback (most recent call last): File "/usr/bin/pip", line ...

  3. Python 解决: from pip import main ImportError: cannot import name 'main'

    此次报错是因为 pip 升级出的问题: from pip import mainif __name__ == '__main__': sys.exit(main()) 改为: from pip imp ...

  4. 执行sudo pip3 ...报错 Traceback (most recent call last): File "/usr/bin/pip3", line 9, in <module> from pip import main ImportError: cannot import name 'main'

    对于普通pip,把pip3改成pip即可,其他的修改一样 1.执行命令 sudo gedit /usr/bin/pip3 2.改成下面的形式 from pip import __main__ # 需要 ...

  5. ImportError: cannot import name 'check_arrays'

    from sklearn.utils.validation import check_arrays 执行 from sklearn.utils.validation import check_arra ...

  6. python import eventlet包时提示ImportError: cannot import name eventlet

    root@zte-desktop:/home/ubuntu/python-threads# cat eventlet.py #!/usr/bin python import eventlet from ...

  7. Ubuntu|ython3 :ImportError: cannot import name 'main'

    1.问题 root@stephen-K55VD:/usr/bin# pip3 Traceback (most recent call last): File "/usr/bin/pip3&q ...

  8. ImportError: cannot import name UnrewindableBodyError

    错误信息: File "/usr/lib/python2.7/site-packages/urllib3/util/__init__.py", line 4, in <mod ...

  9. pip3更新后install package出现ImportError: cannot import name 'main'

    linux下pip3更新后,install包出现main不能导入的情况: bear@bear:~/eclipse-workspace/Python-toolbox$ pip3 install pycr ...

随机推荐

  1. 用Python帮你上马,哪里无码打哪里

    目录 0 引言 1 环境 2 需求分析 3 代码实现 4 代码全景展示 5 后记 0 引言 所谓的像素图,就是对图像做一个颗粒化的效果,使其产生一种妙不可言的朦胧感.费话不多说,先来看一张效果图. ▲ ...

  2. Enum.GetUnderlyingType(obj.GetType())

    Enum.GetUnderlyingType(obj.GetType())获取保存枚举值的数据类型:

  3. python numba讲解

    目录 一:什么是numba 二:如何使用numba   由于python有动态解释性语言的特性,跑起代码来相比java.c++要慢很多,尤其在做科学计算的时候,十亿百亿级别的运算,让python的这种 ...

  4. Android 自定义水平进度条的圆角进度

    有时项目中需要实现水平圆角进度,如下两种,其实很简单     下面开始看代码,先从主界面布局开始看起: <?xml version="1.0" encoding=" ...

  5. 如何只修改EFLAGS寄存器中一个标志位的值?

    版权声明:本文为博主原创文章,2019-08-23,22:21:42转载请附上原文出处链接和本声明.作者By-----溺心与沉浮----博客园   1.写汇编指令只影响CF位的值(不能影响其他标志位 ...

  6. OpenStack Train版 简单部署流程

    environment 1.网络平面 management(管理网络)→软件安装,组件通信 provider(提供实例网络)→:提供者网络:直接获取ip地址,实例之间直接互通   自服务网络(私有网络 ...

  7. windows经典主题 桌面颜色(R58 G110 U165)

  8. Python必备面试题

    Python部分 1. __new__.__init__区别,如何实现单例模式,有什么优点   __new__是一个静态方法,__init__是一个实例方法 __new__返回一个创建的实例,__in ...

  9. java XML解析防止外部实体注入

    /** * 增加防止部实体注入逻辑 * <功能详细描述> * @param reader * @throws SAXException * @see [类.类#方法.类#成员] */ pu ...

  10. 莫烦TensorFlow_11 MNIST优化使用CNN

    import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data #number 1 to 10 d ...