官方文档

https://docs.python.org/zh-cn/3/tutorial/venv.html

用命令行创建虚拟环境(windows)

python -m venv tutorial-env 创建虚拟环境
tutorial-env\Scripts\activate.bat **虚拟环境
pip list 查看虚拟环境安装的包
tutorial-env\Scripts\deactivate.bat 退出虚拟环境

注:以上方法我们一般不用,我们用pycharm管理虚拟环境

用pycharm管理虚拟环境

1 创建虚拟环境

python虚拟环境

2 管理虚拟环境中的包

file -> setting -> project:xxx -> Project Interpreter

python虚拟环境
点击“+”,搜索要安装的库进行安装

python虚拟环境

相关文章:

  • 2022-01-10
  • 2021-07-16
猜你喜欢
  • 2021-08-19
  • 2021-12-10
  • 2021-06-18
相关资源
相似解决方案