zoukankan      html  css  js  c++  java
  • python跨版本包管理方案(pyenv + pipenv)

    背景

    通过对pyenv的探索,已经掌握pyenv对python多版本的管理方法。

    同时pyenv可以集成virtualenv,实现多项目需求的独立环境的搭建,

    from(https://github.com/pyenv/pyenv-virtualenv)

    问题是,对于项目的管理, 我们缺少一个依赖的配置清单,类似 node的 package.json

    这个可以通过pip freeze来生成requirement.txt文件解决。

    但是这个方法,具有一些问题,每次pip install后,需要主动调用pip freeze来更新配置清单。

    针对这个问题,

    于是pipenv闪亮出场

    https://pipenv.pypa.io/en/latest/

    针对新的安装包, 只需要 pipenv install xxx, 就可以将新的文件更新到 pipfile中。

    体验跟node的npm类似。

    于是针对包管理的角度, 我们引入新的python跨版本包管理方案

    pyenv + pipenv

    pyenv -- 跨python版本的os环境管理。

    pipenv -- 跨多个项目的运行环境管理。

    pyenv

    https://github.com/pyenv/pyenv

    pyenv does...

    • Let you change the global Python version on a per-user basis.
    • Provide support for per-project Python versions.
    • Allow you to override the Python version with an environment variable.
    • Search commands from multiple versions of Python at a time. This may be helpful to test across Python versions with tox.

    pipenv

    https://pipenv.pypa.io/en/latest/

    The problems that Pipenv seeks to solve are multi-faceted:

    • You no longer need to use pip and virtualenv separately. They work together.
    • Managing a requirements.txt file can be problematic, so Pipenv uses Pipfile and Pipfile.lock to separate abstract dependency declarations from the last tested combination.
    • Hashes are used everywhere, always. Security. Automatically expose security vulnerabilities.
    • Strongly encourage the use of the latest versions of dependencies to minimize security risks arising from outdated components.
    • Give you insight into your dependency graph (e.g. $ pipenv graph).
    • Streamline development workflow by loading .env files.
  • 相关阅读:
    viewpager中彻底性动态添加、删除Fragment
    Android仿微信界面--使用Fragment实现(慕课网笔记)
    Android progressBar 自定义
    Android 使用PopupWindow实现弹出菜单
    android手机上安装apk时出现解析包错误的一个解决办法
    设计模式 单例模式
    android 自定义AlertDialog
    android listview异步加载图片
    又优化了一下 Android ListView 异步加载图片
    Hadoop概念学习系列之谈谈RPC(三十三)
  • 原文地址:https://www.cnblogs.com/lightsong/p/13754004.html
Copyright © 2011-2022 走看看