- 建立項目根目錄
- 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”