syhsyh9696
V2EX  ›  问与答

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

  •  1
     
  •   syhsyh9696 · Jul 10, 2017 · 4152 views
    This topic created in 3411 days ago, the information mentioned may be changed or developed.
    每用过 Node.js npm,恳请大家谈一下优点,

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

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

    python 下一代的工具 pipfile 重度借鉴了它
    df4VW
    df4VW
    Jul 10, 2017
    5
    现在 yarn 应该算集大成者了吧
    mooncakejs
    mooncakejs
    Jul 10, 2017 via iPhone
    6
    不用说了,pip 最垃圾。npm 没有 yarn 好用
    lightening
    lightening
    Jul 10, 2017❤️3
    7
    平时用 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
    TangMonk
    Jul 10, 2017 via Android
    8
    肯定是 ruby 啊
    Miy4mori
    Miy4mori
    Jul 10, 2017 via iPhone
    9
    pip 最差不用比了
    thecon
    thecon
    Jul 10, 2017
    10
    我投 ruby 一票
    zhuangtongfa
    zhuangtongfa
    Jul 10, 2017
    11
    Ruby 不清楚,如果 npm 和 pip 比的话, npm 完胜
    momocraft
    momocraft
    Jul 10, 2017
    12
    pip 从没弄清楚过
    gem + bundler 是用过的最容易理解的
    npm 还行不过太慢了,配合 yarn 才能用
    mns
    mns
    Jul 10, 2017
    13
    kikyous
    kikyous
    Jul 10, 2017
    14
    ruby 的好用
    cloud107202
    cloud107202
    Jul 10, 2017
    15
    npm 比 pip 好用很多是事实,吐槽的人也蛮多。 但是在 yarn 出来后,npm 迭代速度明显快了。

    有人了解过 npm 怎么 exclude 一个传递依赖么?
    victor
    victor
    Jul 10, 2017
    16
    @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
    syhsyh9696
    OP
    Jul 10, 2017
    17
    @victor 这个好,学习了。
    lightening
    lightening
    Jul 10, 2017
    18
    @victor 社区大多数是用 Python 的,强行用 Ruby 除了给自己找麻烦没什么意义。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2309 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 12:55 · PVG 20:55 · LAX 04:55 · JFK 07:55
    ♥ Do have faith in what you're doing.