安装virtualenv
pip install virtualenv
在当前目录创建虚拟环境命令
python -m virtualenv venv
PS E:\coding\bertopic> python -m virtualenv venv
created virtual environment CPython3.7.0.final.0-64 in 14014ms
creator CPython3Windows(dest=E:\coding\bertopic\venv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\lenovo\AppData\Local\pypa\virtualenv)
added seed packages: pip==24.0, setuptools==68.0.0, wheel==0.42.0
activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
进入虚拟环境
cd venv/Scripts/
PS E:\coding\bertopic\venv\Scripts> activate
激活虚拟环境
activate
PS E:\coding\bertopic\venv\Scripts> .\activate
(venv) PS E:\coding\bertopic\venv\Scripts>
查看python版本
(venv) PS E:\coding\bertopic\venv\Scripts> python --version
Python 3.7.0
退出虚拟环境
deactivate