Creating Virtual Environment
目录
创建虚拟环境
激活虚拟环境
windows:
macos:
python -m venv hal-env
进入到hal-env目录下执行激活命令
cmd命令窗口用这个:
hal-env\Scripts\activate.bat
powershell命令窗口用这个:
hal-env\Scripts\Activate.ps1
source tutorial-env/bin/activate
激活后可以通过 pip list命令查看当前虚拟环境下安装了哪些类库:
pip list
运行结果如下:
(venv) PS E:\python\xxx\xx\venv> pip list
Package Version
---------- -------
pip 22.3.1
setuptools 65.5.1
wheel 0.38.4
[notice] A new release of pip available: 22.3.1 -> 23.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip
(venv) PS E:\xxx\xxx\xxx\venv>