Ubuntu: 使用Python虚拟环境

You probably want to work in a virtualenv :

sudo pip3 install --upgrade virtualenv
  
  

Or if you prefer you can install virtualenv using your favorite packaging
system. E.g., in Ubuntu:


  
  
  1. sudo apt-get update
  2. sudo apt- get install virtualenv

Then work on the virtual_env:


  
  
  1. cd $my_work_dir
  2. virtualenv my_env
  3. . my_env/bin/activate

Or you can specify the Python Version:

virtualenv --no-site-packages --python=python3.5 my_env
  
  

Exit the virtual_env:

deactivate
  
  

Delete the virtual_env:

rm -r my_env
  
  
发布了21 篇原创文章 · 获赞 0 · 访问量 544

猜你喜欢

转载自blog.csdn.net/CiaoTigre/article/details/104289215