简体   繁体   English

在我的虚拟环境中安装 kivy 时出错

[英]error while installing kivy in my virtual enviornment

I opened up cmd and created a virtual environment, and downloaded all the dependencies which are required by kivy but still this error is coming when m trying pip install kivy :我打开 cmd 并创建了一个虚拟环境,并下载了 kivy 所需的所有依赖项,但是当我尝试pip install kivy时仍然出现此错误:

ERROR: Command errored out with exit status 1:
     command: 'C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DHAIRYA GUPTA\\AppData\\Local\\Temp\\pip-install-rmuelogr\\kivy\\setup.py'"'"'; __file__='"'"'C:\\Users\\DHAIRYA GUPTA\\AppData\\Local\\Temp\\pip-install-rmuelogr\\kivy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\DHAIRYA GUPTA\AppData\Local\Temp\pip-pip-egg-info-rfqjrk3i'
         cwd: C:\Users\DHAIRYA GUPTA\AppData\Local\Temp\pip-install-rmuelogr\kivy\
    Complete output (82 lines):
    WARNING: Skipping page https://github.com/kivy-garden/garden/archive/master.zip because the HEAD request got Content-Type: application/zip.The only supported Content-Type is text/html
      ERROR: Command errored out with exit status 1:
       command: 'C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DHAIRYA GUPTA\\AppData\\Local\\Temp\\pip-wheel-m3xayahr\\cython\\setup.py'"'"'; __file__='"'"'C:\\Users\\DHAIRYA GUPTA\\AppData\\Local\\Temp\\pip-wheel-m3xayahr\\cython\\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 'C:\Users\DHAIRYA GUPTA\AppData\Local\Temp\pip-wheel-2znb19oe'
           cwd: C:\Users\DHAIRYA GUPTA\AppData\Local\Temp\pip-wheel-m3xayahr\cython\
      Complete output (7 lines):
      Unable to find pgen, not compiling formal grammar.
      usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
         or: setup.py --help [cmd1 cmd2 ...]
         or: setup.py --help-commands
         or: setup.py cmd --help

      error: invalid command 'bdist_wheel'
      ----------------------------------------
      ERROR: Failed building wheel for cython
    ERROR: Failed to build one or more wheels
     WARNING: The wheel package is not available.
     Traceback (most recent call last):
       File "C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\lib\site-packages\setuptools\installer.py", line 128, in fetch_build_egg
         subprocess.check_call(cmd)
       File "C:\anaconda\lib\subprocess.py", line 364, in check_call
         raise CalledProcessError(retcode, cmd)
     subprocess.CalledProcessError: Command '['C:\\Users\\DHAIRYA GUPTA\\Desktop\\kivy_learn\\kivy_learn\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\DHAIRY~1\\AppData\\Local\\Temp\\tmpyw3mveea', '--quiet', '--find-links', 'https://github.com/kivy-garden/garden/archive/master.zip', 'cython!=0.27,!=0.27.2,<=0.29.10,>=0.24']' returned non-zero exit status 1.

     During handling of the above exception, another exception occurred:

     Traceback (most recent call last):
       File "<string>", line 1, in <module>
       File "C:\Users\DHAIRYA GUPTA\AppData\Local\Temp\pip-install-rmuelogr\kivy\setup.py", line 1073, in <module>
         setup(
       File "C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\lib\site-packages\setuptools\__init__.py", line 143, in setup
         _install_setup_requires(attrs)
       File "C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\lib\site-packages\setuptools\__init__.py", line 138, in _install_setup_requires
         dist.fetch_build_eggs(dist.setup_requires)
       File "C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\lib\site-packages\setuptools\dist.py", line 695, in fetch_build_eggs
         resolved_dists = pkg_resources.working_set.resolve(
       File "C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\lib\site-packages\pkg_resources\__init__.py", line 781, in resolve
         dist = best[req.key] = env.best_match(
       File "C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\lib\site-packages\pkg_resources\__init__.py", line 1066, in best_match
         return self.obtain(req, installer)
       File "C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\lib\site-packages\pkg_resources\__init__.py", line 1078, in obtain
         return installer(requirement)
       File "C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\lib\site-packages\setuptools\dist.py", line 754, in fetch_build_egg
         return fetch_build_egg(self, req)
       File "C:\Users\DHAIRYA GUPTA\Desktop\kivy_learn\kivy_learn\lib\site-packages\setuptools\installer.py", line 130, in fetch_build_egg
         raise DistutilsError(str(e))
     distutils.errors.DistutilsError: Command '['C:\\Users\\DHAIRYA GUPTA\\Desktop\\kivy_learn\\kivy_learn\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\DHAIRY~1\\AppData\\Local\\Temp\\tmpyw3mveea', '--quiet', '--find-links', 'https://github.com/kivy-garden/garden/archive/master.zip', 'cython!=0.27,!=0.27.2,<=0.29.10,>=0.24']' returned non-zero exit status 1.
    Using setuptools
    User distribution detected, avoid portable command.
    Using this graphics system: OpenGL
    WARNING: A problem occurred while running pkg-config --libs --cflags gstreamer-1.0 (code 1)

    b"'pkg-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"

    WARNING: A problem occurred while running pkg-config --libs --cflags gstreamer-1.0 (code 1)

    b"'pkg-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"

    WARNING: A problem occurred while running pkg-config --libs --cflags sdl2 SDL2_ttf SDL2_image SDL2_mixer (code 1)

    b"'pkg-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"

    ERROR: Dependency for context.pyx not resolved: config.pxi
    ERROR: Dependency for compiler.pyx not resolved: config.pxi
    ERROR: Dependency for context_instructions.pyx not resolved: config.pxi
    ERROR: Dependency for fbo.pyx not resolved: config.pxi
    ERROR: Dependency for gl_instructions.pyx not resolved: config.pxi
    ERROR: Dependency for instructions.pyx not resolved: config.pxi
    ERROR: Dependency for opengl.pyx not resolved: config.pxi
    ERROR: Dependency for opengl_utils.pyx not resolved: config.pxi
    ERROR: Dependency for shader.pyx not resolved: config.pxi
    ERROR: Dependency for stencil_instructions.pyx not resolved: config.pxi
    ERROR: Dependency for scissor_instructions.pyx not resolved: config.pxi
    ERROR: Dependency for texture.pyx not resolved: config.pxi
    ERROR: Dependency for vbo.pyx not resolved: config.pxi
    ERROR: Dependency for vertex.pyx not resolved: config.pxi
    ERROR: Dependency for vertex_instructions.pyx not resolved: config.pxi
    ERROR: Dependency for cgl.pyx not resolved: config.pxi
    ERROR: Dependency for cgl_mock.pyx not resolved: config.pxi
    ERROR: Dependency for cgl_gl.pyx not resolved: config.pxi
    ERROR: Dependency for cgl_glew.pyx not resolved: config.pxi
    ERROR: Dependency for cgl_sdl2.pyx not resolved: config.pxi
    ERROR: Dependency for svg.pyx not resolved: config.pxi
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

What should I do?我该怎么办?

Try this and Python 3.8:试试这个和 Python 3.8:

pip3 install --pre --extra-index-url https://kivy.org/downloads/simple kivy

OR或者

try typing:尝试输入:

python -m pip install kivy==

or type this:或输入:

pip3 install kivy==

and hit ENTER than choose from versions the one thar can work for you...并点击 ENTER 而不是从一个可以为你工作的版本中选择......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM