我应该如何从 Python 3.8 降级到 Python 3.7? [复制]

Posted

技术标签:

【中文标题】我应该如何从 Python 3.8 降级到 Python 3.7? [复制]【英文标题】:How should I downgrade to Python 3.7 from Python 3.8? [duplicate] 【发布时间】:2020-08-18 21:50:23 【问题描述】:

我正在尝试安装不支持 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?

【问题讨论】:

我建议 pyenv 安装多个 python 版本github.com/pyenv/pyenv 【参考方案1】:

Python 3.8:试试这个

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

【讨论】:

【参考方案2】:

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

【讨论】:

他没有告诉他使用的是哪个操作系统,但是在linux上卸载python从来都不是一个好主意,许多操作系统元素都使用该语言。

以上是关于我应该如何从 Python 3.8 降级到 Python 3.7? [复制]的主要内容,如果未能解决你的问题,请参考以下文章

如何使用不同的python版本创建一个venv

如何从 Python 3.2 降级到 2.7?

如何从 Internet Explorer 11 降级到 Internet Explorer 10?

如何将 Chrome 版本从版本 94.0.4606.71 降级到版本 94.0.4606.61

如何使用 NPM 降级 Node?

如何将 python 3.7 降级到 3.6?