美文网首页
venv --- 创建虚拟环境

venv --- 创建虚拟环境

作者: yangqing | 来源:发表于2024-05-06 14:24 被阅读0次

    列出可用Python或路径: py.exe -0 or py -0p

    PS C:\Users\yq\Downloads\test> py -0
     -V:3.11 *        Python 3.11 (64-bit)
     -V:3.10          Python 3.10 (64-bit)
     -V:3.9           Python 3.9 (64-bit)
     -V:3.8           Python 3.8 (64-bit)
    PS C:\Users\yq\Downloads\test> py -0p
     -V:3.11 *        C:\Program Files\Python311\python.exe
     -V:3.10          C:\Users\yq\AppData\Local\Programs\Python\Python310\python.exe
     -V:3.9           C:\Users\yq\AppData\Local\Programs\Python\Python39\python.exe
     -V:3.8           C:\Users\yq\AppData\Local\Programs\Python\Python38\python.exe
    

    创建虚拟环境

    PS C:\Users\yq\Downloads> py -3.8 -m venv test
    PS C:\Users\yq\Downloads> cd .\test\
    PS C:\Users\yq\Downloads\test> .\Scripts\activate
    (test) PS C:\Users\yq\Downloads\test> python.exe --version
    Python 3.8.10
    (test) PS C:\Users\yq\Downloads\test> 
    

    相关文章

      网友评论

          本文标题:venv --- 创建虚拟环境

          本文链接:https://www.haomeiwen.com/subject/hnvlfjtx.html