User Tools

Site Tools


ace-cream:virtualenv

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ace-cream:virtualenv [2018/06/04 07:22] – created yangace-cream:virtualenv [2018/06/05 23:24] (current) mingyang
Line 5: Line 5:
 需要使用3.6版本运行程序的同学请自建一个 virtualenv 环境,方法如下:   需要使用3.6版本运行程序的同学请自建一个 virtualenv 环境,方法如下:  
  
-假设用户john,在自定义的路径下(如/data/john)建立一个叫myvenv 的虚拟环境的文件夹:+假设用户john,在自定义的路径下(如/data/users/john)建立一个叫myvenv 的虚拟环境的文件夹:
  
      python3.6 -m venv myvenv      python3.6 -m venv myvenv
-      
 进入myvenv中,输入:  进入myvenv中,输入: 
  
      source bin/activate      source bin/activate
-     curl https://bootstrap.pypa.io/get-pip.py | python3 +     curl https://bootstrap.pypa.io/get-pip.py | python3.6
-     +
 接下来用pip在这个环境中装需要的package ,如  接下来用pip在这个环境中装需要的package ,如 
  
      pip3 install numpy      pip3 install numpy
-      +最后就如往常一样使用 python3 就好。退出环境时可输入: 
-最后就如往常一样使用 python3 就好 + 
 +     deactivate 
 + 
 +[[:ace-cream|返回]]
ace-cream/virtualenv.1528111342.txt.gz · Last modified: 2018/06/04 07:22 by yang