问题描述
我刚刚按照安装指南安装了 pyenv pyenv-win,一切顺利顺利,但我无法将 pyenv 全局 python 作为全局解释器
I have just installed pyenv following the installation guide pyenv-win, things goes smoothly, but i could not make the pyenv global python as the global interpreter
我在安装后使用 pyenv rehash
PS D:\> pyenv versions
3.5.1
3.6.2
3.7.7
* 3.8.2 (set by C:\Users\xxx\.pyenv\pyenv-win\version)
结果
> python --version
> 3.8.4
# expected
> 3.8.2
因此,我无法将 virtualenv
与 pyenv
安装的 python 解释器一起使用
therefore, I am not able to use virtualenv
with the pyenv
installed python interpreter
virtualenv py382-djangodev --python=3.8.2
The path 3.8.2 (from --python=3.8.2) does not exist
推荐答案
我遇到了同样的问题,我终于解决了:
I had the same issue which I finally solved:
1 - 卸载 Python(键入命令 python -V 时的当前版本)
1 - Uninstall Python (your current version when you type the command python -V)
2 - 安装 pyenv-win 并将其添加到 PATH(这里有一些通过 Chocolatey 安装它的可选步骤,将它直接添加到 PATH)
2 - Install pyenv-win and add it to the PATH (here are some optional steps to install it via chocolatey, which adds it directly to the PATH)
2.2 - 安装巧克力
2.2 - Install chocolatey
2.3 - 在管理员 powershell 中运行:choco install pyenv-win
2.3 - In an administrator powershell run: choco install pyenv-win
3 - 开始菜单(windows 键)->管理应用程序执行别名 ->禁用与python相关的别名
3 - Start menu (windows key) -> Manage application execution aliases -> disable aliases related to python
4 - 通过 pyenv 安装所需的 python 版本:pyenv install DESIRED VERSION NUMBER
4 - install the desired python version via pyenv: pyenv install DESIRED VERSION NUMBER
5- 运行 pyenv rehash
6 - 将其设置为 global pyenv global DESIRED VERSION NUMBER
6 - set it as global pyenv global DESIRED VERSION NUMBER
7 - 您可以通过运行命令 python -V
7 - you sould see the desired version by running the command python -V
这篇关于pyenv 全局解释器不适用于 windows10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!