4: Create A Virtualenv( Challenge: Working with the Command Line)

来源:互联网 发布:张郃的死 知乎 编辑:程序博客网 时间:2024/06/04 19:35

You'll want to isolate the Python environment that your script is in by creating a virtual environment. This will allow you to install Python packages with the versions that the script expects.

Instructions

  • Create a Python 3 virtualenv called script.

  • Activate the script virtualenv.

/home/dq$ virtualenv -p /usr/bin/python3 script                                 
Running virtualenv with interpreter /usr/bin/python3                            
Using base prefix '/usr'                                                        
New python executable in /home/dq/script/bin/python3                            
Also creating executable in /home/dq/script/bin/python                          
Installing setuptools, pip, wheel...                                                
/home/dq$ source script/bin/activate                                            
(script) /home/dq$ source script/bin/activate 

0 0
原创粉丝点击