我应该如何从Python 3.8降级到Python 3.7?

时间:2020-05-04 12:59:06

标签: python kivy

我正在尝试安装不支持Python 3.8的kivy。 我有一个在Windows 10上基于kivy制作的应用程序。我正在尝试构建apk。按照说明进行操作后,我发现我已经安装了Python 3.8,并且在尝试在VM LUbuntu上安装kivy时总是出现错误。

I get this error when I try to install kivy using the sudo pip3 install kivy command.

raise DistutilsError(str(e))                                               
     distutils.errors.DistutilsError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpq9k_yp5j', '--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                                                                
    Using this graphics system: OpenGL                                              
    WARNING: A problem occurred while running pkg-config --libs --cflags gstreamer-1.0 (code 1)                                                                         

    b"Package gstreamer-1.0 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `gstreamer-1.0.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'gstreamer-1.0' found\n"                              

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

    b"Package sdl2 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `sdl2.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'sdl2' found\nPackage SDL2_ttf was not found in the pkg-config search path.\nPerhaps you should add the directory containing `SDL2_ttf.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'SDL2_ttf' found\nPackage SDL2_image was not found in the pkg-config search path.\nPerhaps you should add the directory containing `SDL2_image.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'SDL2_image' found\nPackage SDL2_mixer was not found in the pkg-config search path.\nPerhaps you should add the directory containing `SDL2_mixer.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'SDL2_mixer' found\n"                                 

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

    b"Package pangoft2 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `pangoft2.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'pangoft2' found\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. 

我应该如何降级到Python 3.7?

2 个答案:

答案 0 :(得分:4)

Python 3.8:试试这个

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

答案 1 :(得分:0)

如何卸载Python 3.8,然后下载Python 3.7的安装程序并安装它。