V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
syhsyh9696
V2EX  ›  问与答

包管理,哪个更方便(Ruby/ Python /Node.js)

  •  1
     
  •   syhsyh9696 · 2017-07-10 00:07:49 +08:00 · 3206 次点击
    这是一个创建于 2475 天前的主题,其中的信息可能已经有所发展或是发生改变。
    每用过 Node.js npm,恳请大家谈一下优点,

    Ruby 的 gem bundler rvm 等优点突出,使用方便,比 pip 不知道高到哪里去了。

    恳请大家讲一讲各自的优缺点,谢谢大家。
    18 条回复    2017-07-10 17:13:52 +08:00
    Kilerd
        1
    Kilerd  
       2017-07-10 00:40:21 +08:00 via iPhone   ❤️ 1
    rust 的 cargo 是我用过最好的
    lxml
        2
    lxml  
       2017-07-10 01:12:30 +08:00
    其他的不了解,先小喷一个 pip,连个全局更新都没有,搞得每次都只能用 alias 一个这玩意去更新
    pip freeze – local | grep -v '^-e' | cut -d = -f 1 | xargs pip install -U
    有其他方法的,欢迎赐教
    Jafee
        3
    Jafee  
       2017-07-10 01:14:09 +08:00 via iPhone
    觉得 Java 的 Maven 也不错。
    jigloo
        4
    jigloo  
       2017-07-10 01:15:06 +08:00 via Android
    cargo。时髦又实用。

    python 下一代的工具 pipfile 重度借鉴了它
    df4VW
        5
    df4VW  
       2017-07-10 05:09:43 +08:00
    现在 yarn 应该算集大成者了吧
    mooncakejs
        6
    mooncakejs  
       2017-07-10 05:21:50 +08:00 via iPhone
    不用说了,pip 最垃圾。npm 没有 yarn 好用
    lightening
        7
    lightening  
       2017-07-10 05:47:38 +08:00   ❤️ 3
    平时用 Ruby,做机器学习换到 Python 真是要哭了。Pip 居然要依赖 virtualenv 配合,如果还需要管理不同版本的 python 就更复杂了。另外我至今不知道应该手动修改 requirement.txt 还是应该 pip freeze. 前者可能会忘加包,后者会把系统装了的但是我不想包括的包给加进去。现在新出的 Pipfile 应该好点了,但是目前的似乎仍然需要依赖 virtualenv。

    相比之下 Ruby 的 bundler 就好多了,一个 Gemfile 手写,记录想要的包;另一个 Gemfile.lock 记录锁定后的版本。不想加的不要加。也不需要 virtualenv 这类东西。

    前面有同学提到 Cargo,因为 Rust 最初的包管理项目失败了,后来 Mozilla 请了 Yehuda Katz 和 Carl Lerche 两位做了 Cargo。他们两位也正是 Bundler 的主要作者。
    TangMonk
        8
    TangMonk  
       2017-07-10 08:12:45 +08:00 via Android
    肯定是 ruby 啊
    Miy4mori
        9
    Miy4mori  
       2017-07-10 09:48:21 +08:00 via iPhone
    pip 最差不用比了
    thecon
        10
    thecon  
       2017-07-10 09:49:39 +08:00
    我投 ruby 一票
    zhuangtongfa
        11
    zhuangtongfa  
       2017-07-10 09:54:38 +08:00
    Ruby 不清楚,如果 npm 和 pip 比的话, npm 完胜
    momocraft
        12
    momocraft  
       2017-07-10 09:58:31 +08:00
    pip 从没弄清楚过
    gem + bundler 是用过的最容易理解的
    npm 还行不过太慢了,配合 yarn 才能用
    mnsw
        13
    mnsw  
       2017-07-10 10:00:30 +08:00
    kikyous
        14
    kikyous  
       2017-07-10 10:50:19 +08:00
    ruby 的好用
    cloud107202
        15
    cloud107202  
       2017-07-10 11:30:38 +08:00
    npm 比 pip 好用很多是事实,吐槽的人也蛮多。 但是在 yarn 出来后,npm 迭代速度明显快了。

    有人了解过 npm 怎么 exclude 一个传递依赖么?
    victor
        16
    victor  
       2017-07-10 12:14:49 +08:00
    @lightening 机器学习?

    Awesome Machine Learning with Ruby and Awesome NLP with Ruby - A pair of curated lists of resources, tutorials, libraries and so on for Rubyists in the AI space.

    https://github.com/arbox/machine-learning-with-ruby
    https://github.com/arbox/nlp-with-ruby

    为何不试试自己熟悉的 Ruby 呢,
    syhsyh9696
        17
    syhsyh9696  
    OP
       2017-07-10 15:08:17 +08:00
    @victor 这个好,学习了。
    lightening
        18
    lightening  
       2017-07-10 17:13:52 +08:00
    @victor 社区大多数是用 Python 的,强行用 Ruby 除了给自己找麻烦没什么意义。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4941 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 330ms · UTC 09:42 · PVG 17:42 · LAX 02:42 · JFK 05:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.