天天看點

pipenv建立Python虛拟環境

  1. 建立項目根目錄
  2. shift+右鍵在根目錄中打開power shell
  3. pipenv install

    建立虛拟環境
  4. pipenv shell

    顯式激活虛拟環境
  5. 在pycharm中将python解釋器設定為虛拟環境中的解釋器(

    pipenv --venv

    可檢視項目對應的虛拟環境路徑)

tips:

pipenv install 安裝子產品時有時候會很慢

可以設定國内源:Pipfile檔案中[source]下面url屬性,比如修改成:url = “https://pypi.tuna.tsinghua.edu.cn/simple”