Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
169 views
in Technique[技术] by (71.8m points)

python - Error when trying to install open AI gym on Windows

I am trying to pip install gym on my Windows machine with Python 3.9. I was getting a pillow error, so I uninstalled pillow version 8.1.0 and tried to install again. This time it seems like pillow 7.2.0 is being installed but there is a zlib error. I have spent some time trying to install zlib on Windows, but I couldn't figure it out.

C:WINDOWSsystem32>pip install gym
Collecting gym
  Using cached gym-0.18.0-py3-none-any.whl
Collecting Pillow<=7.2.0
  Using cached Pillow-7.2.0.tar.gz (39.1 MB)
Requirement already satisfied: scipy in c:userss1612415appdatalocalprogramspythonpython39libsite-packages (from gym) (1.6.0)
Collecting cloudpickle<1.7.0,>=1.2.0
  Using cached cloudpickle-1.6.0-py3-none-any.whl (23 kB)
Requirement already satisfied: numpy>=1.10.4 in c:userss1612415appdatalocalprogramspythonpython39libsite-packages (from gym) (1.19.5)
Requirement already satisfied: pyglet<=1.5.0,>=1.4.0 in c:userss1612415appdatalocalprogramspythonpython39libsite-packages (from gym) (1.5.0)
Requirement already satisfied: future in c:userss1612415appdatalocalprogramspythonpython39libsite-packages (from pyglet<=1.5.0,>=1.4.0->gym) (0.18.2)
Building wheels for collected packages: Pillow
  Building wheel for Pillow (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:userss1612415appdatalocalprogramspythonpython39python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\s1612415\AppData\Local\Temp\pip-install-cji2nue6\pillow_1f3ada70debe4859b9754f7ef20dbc19\setup.py'"'"'; __file__='"'"'C:\Users\s1612415\AppData\Local\Temp\pip-install-cji2nue6\pillow_1f3ada70debe4859b9754f7ef20dbc19\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:Userss1612415AppDataLocalTemppip-wheel-nh0esryx'
       cwd: C:Userss1612415AppDataLocalTemppip-install-cji2nue6pillow_1f3ada70debe4859b9754f7ef20dbc19
  Complete output (172 lines):
  C:Userss1612415AppDataLocalTemppip-install-cji2nue6pillow_1f3ada70debe4859b9754f7ef20dbc19setup.py:42: RuntimeWarning: Pillow 7.2.0 does not support Python 3.9 and does not provide prebuilt Windows binaries. We do not recommend building from source on Windows.
    warnings.warn(
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win-amd64-3.9
  creating buildlib.win-amd64-3.9PIL
  copying srcPILBdfFontFile.py -> buildlib.win-amd64-3.9PIL
  copying srcPILBlpImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILBmpImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILBufrStubImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILContainerIO.py -> buildlib.win-amd64-3.9PIL
  copying srcPILCurImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILDcxImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILDdsImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILEpsImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILExifTags.py -> buildlib.win-amd64-3.9PIL
  copying srcPILfeatures.py -> buildlib.win-amd64-3.9PIL
  copying srcPILFitsStubImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILFliImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILFontFile.py -> buildlib.win-amd64-3.9PIL
  copying srcPILFpxImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILFtexImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILGbrImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILGdImageFile.py -> buildlib.win-amd64-3.9PIL
  copying srcPILGifImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILGimpGradientFile.py -> buildlib.win-amd64-3.9PIL
  copying srcPILGimpPaletteFile.py -> buildlib.win-amd64-3.9PIL
  copying srcPILGribStubImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILHdf5StubImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILIcnsImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILIcoImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImage.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageChops.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageCms.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageColor.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageDraw.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageDraw2.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageEnhance.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageFile.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageFilter.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageFont.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageGrab.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageMath.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageMode.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageMorph.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageOps.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImagePalette.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImagePath.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageQt.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageSequence.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageShow.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageStat.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageTk.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageTransform.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImageWin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILImtImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILIptcImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILJpeg2KImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILJpegImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILJpegPresets.py -> buildlib.win-amd64-3.9PIL
  copying srcPILMcIdasImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILMicImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILMpegImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILMpoImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILMspImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPaletteFile.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPalmImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPcdImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPcfFontFile.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPcxImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPdfImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPdfParser.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPixarImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPngImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPpmImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPsdImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPSDraw.py -> buildlib.win-amd64-3.9PIL
  copying srcPILPyAccess.py -> buildlib.win-amd64-3.9PIL
  copying srcPILSgiImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILSpiderImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILSunImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILTarIO.py -> buildlib.win-amd64-3.9PIL
  copying srcPILTgaImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILTiffImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILTiffTags.py -> buildlib.win-amd64-3.9PIL
  copying srcPILWalImageFile.py -> buildlib.win-amd64-3.9PIL
  copying srcPILWebPImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILWmfImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILXbmImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILXpmImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPILXVThumbImagePlugin.py -> buildlib.win-amd64-3.9PIL
  copying srcPIL\_binary.py -> buildlib.win-amd64-3.9PIL
  copying srcPIL\_tkinter_finder.py -> buildlib.win-amd64-3.9PIL
  copying srcPIL\_util.py -> buildlib.win-amd64-3.9PIL
  copying srcPIL\_version.py -> buildlib.win-amd64-3.9PIL
  copying srcPIL\__init__.py -> buildlib.win-amd64-3.9PIL
  copying srcPIL\__main__.py -> buildlib.win-amd64-3.9PIL
  running egg_info
  writing srcPillow.egg-infoPKG-INFO
  writing dependency_links to srcPillow.egg-infodependency_links.txt
  writing top-level names to srcPillow.egg-infoop_level.txt
  reading manifest file 'srcPillow.egg-infoSOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.c'
  warning: no files found matching '*.h'
  warning: no files found matching '*.sh'
  warning: no previously-included files found matching '.appveyor.yml'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching '.editorconfig'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'codecov.yml'
  warning: no previously-included files matching '.git*' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.so' found anywhere in distribution
  no previously-included directories found matching '.ci'
  writing manifest file 'srcPillow.egg-infoSOURCES.txt'
  running build_ext


  The headers or library files could not be found for zlib,
  a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html

  Traceback (most recent call last):
    File "C:Userss1612415AppDataLocalTemppip-install-cji2nue6pillow_1f3ada70debe4859b9754f7ef20dbc19setup.py", line 864, in <module>
      setup(
    File "c:userss1612415appdatalocalprogramspythonpython39libsite-packagessetuptools\__init__.py", line 165, in setup
      return distutils.core.setup(**attrs)
    File "c:userss1612415appdatalocalprogramspythonpython39libdistutilscore.py", line 148, in setup
      dist.run_commands()
    File "c:userss1612415appdatalocalprogramspythonpython39libdistutilsdist.py", line 966, in run_commands
      self.run_command(cmd)
    File "c:userss1612415appdatalocalprogramspythonpython39libdistutilsdist.py", line 985, in run_command
      cmd_obj.run()
    File "c:userss1612415appdatalocalprogramspythonpython39libsite-packageswheeldist_wheel.py", line 299, in run
      self.run_command('build')
    File "c:userss1612415appdatalocalprogramspythonpython39libdistutilscmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:userss1612415appdatalocalprogramspythonpython39libdistutilsdist.py", line 985, in run_command
      cmd_obj.run()
    File "c:userss1612415appdatalocalprogramspythonpython39libdistutilscommanduild.py", line 135, in run
      self.run_command(cmd_name)
    File "c:userss1612415appdatalocalprogramspythonpython39libdistutilscmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:userss1612415appdatalocalprogramspythonpython39libdistutilsdist.py", line 985, in run_command
      cmd_obj.run()
    File "c:userss1612415appdatalocalprogramspythonpython39libdistutilscommanduild_ext.py", line 340, in run
      self.build_extensions()
    File "C:Userss1612415AppDataLocalTemppip-

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...