官术网_书友最值得收藏!

How to do it...

  1. The original, normal way to create a virtual environment comprises three separate steps. First, the virtual environment is created:
      >>> python3 -m venv <dir_name>
  1. Next, the virtual environment is activated so it can be used:
      >>> source <dir_name>/bin/activate
  1. Finally, pip is used to install the necessary module:
      >>> pip install <module>
  1. To make this process easier, pipenv combines the pip and venv calls, so first we have to move to the desired directory where the virtual environment will be placed:
      >>> cd <project_name>
  1. Next, we simply call pipenv to create the environment and install the desired module:
      >>> pipenv install <module>
  1. Use pipenv to call the shell command and wait for the shell to be created. Observe that a virtual environment has been created and the command prompt is now activated within the environment. The following screenshot includes the commands from the previous steps, for clarity:

主站蜘蛛池模板: 黔东| 陇川县| 老河口市| 和平县| 黄大仙区| 乐昌市| 正镶白旗| 会泽县| 香河县| 蒙阴县| 洛南县| 宁河县| 凌源市| 南乐县| 织金县| 鄂托克前旗| 乌拉特后旗| 晋宁县| 海晏县| 霍州市| 松滋市| 新乡市| 浦江县| 贵溪市| 蒲江县| 德庆县| 云龙县| 西昌市| 西吉县| 梁河县| 大竹县| 宁津县| 大洼县| 营山县| 灌南县| 长岛县| 七台河市| 望都县| 洛南县| 黎川县| 莫力|