Python学习

Python 学习

配置虚拟环境

  1. 创建虚拟环境

    1
    python3 -m venv myenv
  2. pip 配置源

    1
    2
    3
    4
    5
    6
    7
    pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

    # 查看当前配置
    pip config list

    # 恢复默认源
    pip config unset global.index-url
  3. VS Code 插件 Code Runner 使用 python 虚拟环境

    1
    "python": "set PYTHONIOENCODING=utf8 && $pythonPath -u $fullFileName",