
1 julyclyde 2014-11-10 14:55:37 +08:00 virtualenv是利用了“python启动时,首先以python可执行文件的路径为基准,尝试搜索标准库”的这个行为,做的一个包装性质的东西,把{python可执行文件,标准库,库安装工具}这个最小集合放在一个目录树下面,而libpython是用系统级的,以节省空间 |
2 arbipher OP |
3 ophunter 2014-11-10 15:28:31 +08:00 关注 |
4 julyclyde 2014-11-10 15:38:49 +08:00 @arbipher 是指pip;libpython是python的语言解析执行功能所在的库,是个so,python可执行文件动态链接了libpython |
5 arbipher OP @julyclyde > libpython是python的语言解析执行功能所在的库 “以python可执行文件的路径为基准,尝试搜索标准库” “python可执行文件动态链接了libpython” 这两者的关系是什么。。。我糊涂了。。。 |
6 andrewpsy 2014-11-10 16:21:41 +08:00 楼主,先把你每次都source的activate文件看了,我也是最近刚开始学。 |
7 dagger 2014-11-10 16:37:33 +08:00 pyenv管理与系统环境隔离的python解释器版本,比如2.7.8、3.4.2 virtualenv管理与系统环境隔离的包安装,比如可以在x_venv里安装a包的1.0版,在y_venv里安装a包的1.1版,两者互不影响,也不影响系统环境中的安装包 pyenv包含有virtualenv,可以选择生成的venv是基于哪个解释器环境的 如果只是单独安装virtualenv,不安装pyenv,那么生成的venv就是基于系统环境解释器的了 |
8 arbipher OP |
10 julyclyde 2014-11-11 16:21:58 +08:00 libpython就是python语言本身 而/some/path/python 只是个启动程序而已 |
11 arbipher OP @andrewpsy https://virtualenv.pypa.io/en/latest/virtualenv.html#activate-script This will change your $PATH so its first entry is the virtualenv’s bin/ directory. (You have to use source because it changes your shell environment in-place.) This is all it does; it’s purely a convenience. If you directly run a script or the python interpreter from the virtualenv’s bin/ directory (e.g. path/to/env/bin/pip or /path/to/env/bin/python script.py) there’s no need for activation. activate只是改了PATH。 |
12 arrowna 2016-06-04 23:33:34 +08:00 windows 下安装不了 pywin 。。。 |
13 hyyou2010 2016-09-22 22:02:38 +08:00 http://masnun.com/2016/04/10/python-pyenv-pyvenv-virtualenv-whats-the-difference.html pyenv 在系统中安装多个版本的 python 解释器本身 pyvenv 系统自带 创建一个虚拟环境,用来分隔依赖性( dependencies ),比如有的项目需要 django1.5 ,有的需要 2.0 依然使用系统的解释器及其版本 virtualenv 同 pyvenv ,区别在于: 第三方,需安装 支持 2.6~3.5 版本 似乎有点不兼容的小问题 |