V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
liemehoc
V2EX  ›  Python

请教大家是怎么管理 python 包的

  •  
  •   liemehoc · 2014-05-16 20:19:36 +08:00 · 4413 次点击
    这是一个创建于 3631 天前的主题,其中的信息可能已经有所发展或是发生改变。
    是用pip之类的还是用操作系统的包管理(我用的是archlinux)
    觉得两种方式都不完美
    15 条回复    2014-05-20 13:15:14 +08:00
    dreampuf
        1
    dreampuf  
       2014-05-16 20:28:02 +08:00
    pip。跟着Python Instance 走。
    liemehoc
        2
    liemehoc  
    OP
       2014-05-16 20:37:09 +08:00
    @dreampuf pip安装的包在操作系统的包管理中检测不到的,还会跳出来再让你装一遍
    MayLava
        3
    MayLava  
       2014-05-16 20:55:38 +08:00
    virtualenv + pip
    尽量主环境不安装包
    alsotang
        4
    alsotang  
       2014-05-16 20:59:35 +08:00
    @liemehoc 这不是很好吗?
    skydiver
        5
    skydiver  
       2014-05-16 21:02:51 +08:00 via Android
    其实无所谓……一些需要编译的用包管理器比较好,还方便升级。管理器没有的只能pip了
    xingxiucun
        6
    xingxiucun  
       2014-05-16 21:45:28 +08:00
    一般都pip 怎么方便怎么来 pacman 安装常用的的还不错
    haroldwu
        7
    haroldwu  
       2014-05-16 22:22:21 +08:00
    系统程式直接按相依需求让系统装
    自己的专案套 virtualenv + pip 跟系统隔离
    不要让系统跟开发环境共用 lib
    dreampuf
        8
    dreampuf  
       2014-05-16 23:37:35 +08:00
    @liemehoc 你不应该去污染系统环境。
    timonwong
        9
    timonwong  
       2014-05-17 00:21:39 +08:00
    对于没有外网的部署机器,mirror一个pypi镜像很慢的情况下。我的选择是
    python + virtualenv
    然后 pip 安装打包好的 wheels
    sandtears
        10
    sandtears  
       2014-05-17 00:58:06 +08:00
    依赖比较少比较容易装的包用 pip, 比如 requests, flask 之类的。

    wxpython, pyqt 这种依赖很多的一般就是 `apt-get install` 或者下安装包装(Windows 下)
    duhastmich
        11
    duhastmich  
       2014-05-17 07:53:34 +08:00
    也可以pyenv 然后全局装
    banbanchs
        12
    banbanchs  
       2014-05-17 09:50:55 +08:00
    arch还是能用系统包管理就用系统包管理,pacman和pip有时会冲突,而且用pip会找不到依赖

    开发环境用virtualenv + pip
    ericFork
        13
    ericFork  
       2014-05-17 10:02:12 +08:00
    打包,用包管理装……
    Keyes
        14
    Keyes  
       2014-05-17 14:15:55 +08:00
    通常情况下都是用pip+virtualenv的,系统包都是装其他包时候顺带依赖上去的
    geew
        15
    geew  
       2014-05-20 13:15:14 +08:00
    必须virtualenv
    没有用过的话看这里: http://hatcatxyz.sinaapp.com/?p=150
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3355 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:07 · PVG 20:07 · LAX 05:07 · JFK 08:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.