- 创建项目根目录
- shift+右键在根目录中打开power shell
pipenv install
创建虚拟环境pipenv shell
显式激活虚拟环境- 在pycharm中将python解释器设置为虚拟环境中的解释器(
pipenv --venv
可查看项目对应的虚拟环境路径)
tips:
pipenv install 安装模块时有时候会很慢
可以设置国内源:Pipfile文件中[source]下面url属性,比如修改成:url = “https://pypi.tuna.tsinghua.edu.cn/simple”