代码改变世界

Create your first isolated Python environment

  abce  阅读(222)  评论(0编辑  收藏  举报
复制代码
# Install virtualenv for Python 2.7 and create a sandbox called my27project:
pip2.7 install virtualenv
virtualenv-2.7 my27project
 
# Use the built-in pyvenv program in Python 3.3 to create a sandbox called my33project:
pyvenv-3.3 my33project
 
# Check the system Python interpreter version:
python --version
# This will show Python 2.6.6
 
# Activate the my27project sandbox and check the version of the default Python interpreter in it:
source my27project/bin/activate
python --version
# This will show Python 2.7.6
deactivate
 
# Activate the my33project sandbox and check the version of the default Python interpreter in it:
source my33project/bin/activate
python --version
# This will show Python 3.3.5
deactivate
复制代码

When you use virtualenv to create a sandbox it will automatically install setuptools and pip for you inside the sandbox. If you use pyvenv then you must do it yourself. You can reuse the ez_setup.py file you downloaded earlier and just run it after you activate your new sandbox.

编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2015-08-10 Oracle 12C -- 扩展varchar2、nvarchar2、和raw数据类型的大小限制
2015-08-10 Oracle 12C -- top-n查询新特性
2015-08-10 Oracle 12C -- native left outer join的加强
点击右上角即可分享
微信分享提示