You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用pyenv更新Python版本(3.6.2至3.6.5)及操作步骤咨询

Upgrading Python from 3.6.2 to 3.6.5 with pyenv

Hey there! Your core approach is totally on the right track—let me break this down into a streamlined, error-proof process with some handy tips to make it smoother:

  • First, install the new Python version
    Start by installing Python 3.6.5 via pyenv, just as you thought:

    pyenv install 3.6.5
    

    If you want to confirm 3.6.5 is available (in case of any minor delays in the pyenv repo), you can list all available 3.6.x versions with:

    pyenv install --list | grep 3.6
    
  • Export your existing package list
    Before switching, grab a snapshot of all packages in your 3.6.2 environment. First activate the old version:

    # Use `pyenv global 3.6.2` if it's your system-wide default
    pyenv local 3.6.2
    

    Then export the packages to a requirements file:

    pip freeze > requirements.txt
    
  • Switch to the new environment and install packages
    Activate your freshly installed 3.6.5 version:

    # Use `pyenv global 3.6.5` for system-wide use
    pyenv local 3.6.5
    

    It’s smart to upgrade pip first in the new environment to avoid compatibility hiccups:

    pip install --upgrade pip
    

    Now install all your old packages from the requirements file:

    pip install -r requirements.txt
    
  • Verify everything works
    Run your projects, scripts, or tests in the 3.6.5 environment to make sure all dependencies function as expected. Don’t skip this step—better safe than sorry!

  • Uninstall the old version (optional)
    Once you’re confident the new environment is stable and you no longer need 3.6.2, you can remove it:

    pyenv uninstall 3.6.2
    

    Just double-check that no existing projects are still configured to use 3.6.2 before deleting it.

Quick note for pyenv-virtualenv users

If you’re using virtual environments tied to specific Python versions, create a new virtualenv for 3.6.5 first, then repeat the requirements export/import steps into that new virtualenv instead of the base 3.6.5 environment.

内容的提问来源于stack exchange,提问作者adamstueckrath

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:06:45