- Secret Recipes of the Python Ninja
- Cody Jackson
- 146字
- 2021-06-25 22:14:39
How to do it...
- The original, normal way to create a virtual environment comprises three separate steps. First, the virtual environment is created:
>>> python3 -m venv <dir_name>
- Next, the virtual environment is activated so it can be used:
>>> source <dir_name>/bin/activate
- Finally, pip is used to install the necessary module:
>>> pip install <module>
- 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>
- Next, we simply call pipenv to create the environment and install the desired module:
>>> pipenv install <module>
- 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:
推薦閱讀
- Testing with JUnit
- OpenCV實例精解
- Microsoft Dynamics 365 Extensions Cookbook
- PHP 7底層設(shè)計與源碼實現(xiàn)
- Cassandra Design Patterns(Second Edition)
- FFmpeg入門詳解:音視頻原理及應(yīng)用
- SQL Server 2012數(shù)據(jù)庫管理與開發(fā)項目教程
- Apache Mesos Essentials
- 西門子S7-200 SMART PLC編程從入門到實踐
- 新一代SDN:VMware NSX 網(wǎng)絡(luò)原理與實踐
- 詳解MATLAB圖形繪制技術(shù)
- Spring Boot實戰(zhàn)
- Developing SSRS Reports for Dynamics AX
- SQL Server 2008中文版項目教程(第3版)
- Professional JavaScript