错误:访问 python 的路径不存在 - 使用适用于 Windows 的 virtualenvwrapper 创建新的虚拟环境不起作用

问题描述

我尝试关注 these instructions,但它在我的 Windows 10 - 使用 PowerShell 的系统上不起作用。

我收到此错误

ERROR: The path to access to python doesn't exist. Python directory = ...

整个 CLI 输出

查找 Python 可执行文件

PS C:\Users\username\Projects\project> (gcm python).Path
C:\Users\username\.pyenv\pyenv-win\shims\python.bat

尝试创建一个新的虚拟环境:

PS C:\Users\username\Projects\project> mkvirtualenv -Python C:\Users\username\.pyenv\pyenv-win\shims -Name MyNewEnv 

  ERROR: The path to access to python doesn't exist. Python directory = C:\Users\username\.pyenv\pyenv-win\shims

检查提供的 Python 路径的内容以确认其正确性:

PS C:\Users\username\Projects\project> ls C:\Users\username\.pyenv\pyenv-win\shims\


    Directory: C:\Users\username\.pyenv\pyenv-win\shims


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        26.04.2021     16:29             51 easy_install
-a----        26.04.2021     16:29             51 easy_install-3.9
-a----        26.04.2021     16:29             66 easy_install-3.9.bat
-a----        26.04.2021     16:29             66 easy_install.bat
-a----        26.04.2021     16:29             51 pip
-a----        26.04.2021     16:29             66 pip.bat
-a----        26.04.2021     16:29             51 pip3
-a----        26.04.2021     16:29             51 pip3.9
-a----        26.04.2021     16:29             66 pip3.9.bat
-a----        26.04.2021     16:29             66 pip3.bat
-a----        26.04.2021     16:29             43 python
-a----        26.04.2021     16:29             58 python.bat
-a----        26.04.2021     16:29             43 python3
-a----        26.04.2021     16:29             43 python3.9
-a----        26.04.2021     16:29             58 python3.9.bat
-a----        26.04.2021     16:29             58 python3.bat
-a----        26.04.2021     16:29             43 python39
-a----        26.04.2021     16:29             58 python39.bat
-a----        26.04.2021     16:29             43 pythonw
-a----        26.04.2021     16:29             58 pythonw.bat
-a----        26.04.2021     16:29             43 pythonw3
-a----        26.04.2021     16:29             43 pythonw3.9
-a----        26.04.2021     16:29             58 pythonw3.9.bat
-a----        26.04.2021     16:29             58 pythonw3.bat
-a----        26.04.2021     16:29             43 pythonw39
-a----        26.04.2021     16:29             58 pythonw39.bat

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)