windows 使用pyenv-win 管理多python 版本

 链接: GitHub - pyenv-win/pyenv-win: pyenv for Windows. pyenv is a simple python version management tool. It lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.

简介

        pyenv-win 是windows 下的一个python 多版本管理工具。

使用

命令
用法
local Set or show the local application-specific Python version
                global                 Set or show the global Python version
shell  Set or show the shell-specific Python version
install  Install 1 or more versions of Python 
uninstall Uninstall 1 or more versions of Python
updateUpdate the cached version DB
rehashRehash pyenv shims (run this after switching Python versions)
vnameShow the current Python version
version Show the current Python version and its origin
version-nameShow the current Python version
versionsList all Python versions available to pyenv
exec  Runs an executable by first preparing PATH so that the selected Python
which Display the full path to an executable
whence List all Python versions that contain the given executable

下载

一. windows terminal 

windows shell 使用 powershell 。  直接Microsoft Store 搜索 windows terminal 。 点击下载安装即可。

二. 通过pip下载 pyenv-win

首先下载一个python 版本。 https://www.python.org/downloads/windows/ 。下载后点击安装

然后在python 的bin 目录里面执行 pip install pyenv-win --target [your path where  to store pyenv]

三. 为 pyenv 配置系统变量

操作 过程: 1.【此电脑】  -> 【属性】-> 【高级系统设置】-> 【环境变量】(以下操作更改的都是系统变量)-> 【系统变量】-> 【新建变量】 

 

2. 【双击系统变量的path】 -> 【新建】

测试 

        重启当前 cmd 或 powershell。  执行 pyenv --version ,能输出版本号即配置成功。如果有错误,再检查一遍有没有遗漏或拼写错误。

PS : powershell 执行pyenv 可能有个问题

无法加载文件 C:\Users\DH\Desktop\cs\rename.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。

此时 执行下 set-executionpolicy remotesigned 。 再重新执行命令即可。

具体看: PowerShell:因为在此系统上禁止运行脚本,解决方法 - 简书

 

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: pyenv是一种Python版本管理工具,可以用来改变全局的Python版本,安装多个版本Python,设置目录级别的Python版本,以及创建和管理虚拟环境。通过pyenv,可以实现对不同版本Python进行管理,并且可以通过virtualenv设置不同的虚拟环境对Python库的版本进行管理。这样,在程序运行的过程中,可以根据不同的运行需求使用不同的Python版本。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* [Python版本管理-pyenv](https://blog.csdn.net/peng78585/article/details/131767881)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [使用pyenv管理python版本](https://blog.csdn.net/Zhangsan0219/article/details/121237529)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Python版本管理工具之pyenv](https://blog.csdn.net/YiJie__ShuSheng/article/details/90448944)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值