7*4 2012-01-04 11:37 采纳率: 50%
浏览 211

与 Ruby 的捆绑器 / Perl 纸盒等同的 Python 语言有哪些?

I know about virtualenv and pip. But these are a bit different from bundler/carton.

For instance:

  • pip writes the absolute path to shebang or activate script
  • pip doesn't have the exec sub command (bundle exec bar)
  • virtualenv copies the Python interpreter to a local directory

Does every Python developer use virtualenv/pip? Are there other package management tools for Python?

转载于:https://stackoverflow.com/questions/8726207/what-are-the-python-equivalents-to-rubys-bundler-perls-carton

  • 写回答

6条回答 默认 最新

  • ℙℕℤℝ 2012-01-05 01:17
    关注

    From what i've read about bundler — pip without virtualenv should work just fine for you. You can think of it as something between regular gem command and bundler. Common things that you can do with pip:

    1. Installing packages (gem install)

      pip install mypackage
      
    2. Dependencies and bulk-install (gemfile)

      Probably the easiest way is to use pip's requirements.txt files. Basically it's just a plain list of required packages with possible version constraints. It might look something like:

      nose==1.1.2
      django<1.3
      PIL
      

      Later when you'd want to install those dependencies you would do:

      $ pip install -r requirements.txt
      

      A simple way to see all your current packages in requirements-file syntax is to do:

      $ pip freeze
      

      You can read more about it here.

    3. Execution (bundler exec)

      All python packages that come with executable files are usually directly available after install (unless you have custom setup or it's a special package). For example:

      $ pip install gunicorn
      $ gunicorn -h 
      
    4. Package gems for install from cache (bundler package)

      There is pip bundle and pip zip/unzip. But i'm not sure if many people use it.

    p.s. If you do care about environment isolation you can also use virtualenv together with pip (they are close friends and work perfectly together). By default pip installs packages system-wide which might require admin rights.

    评论

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值