1373 links
192 private links
  • Liens de WebManiaK
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
  • Astuce pour mettre à jour pip sur Ubuntu

    D'après le fichier /usr/lib/python3.7/ensurepip/init.py (du module "ensurepip" dont l'utilité est de servir de bootstrap pour les environnements virtuels) aux lignes 61-67:


    def version():
    """
    Returns a string specifying the bundled version of pip.
    """
    wheel_names = glob.glob('/usr/share/python-wheels/pip-*.whl')
    assert len(wheel_names) == 1, wheel_names
    return os.path.basename(wheel_names[0]).split('-')[1]

    On remarque que la version de pip est déterminée par le package wheel situé dans /usr/share/python-wheels.

    Dès lors, il suffit de mettre à jour pip comme suit:

    $ cd ~/
    $ pip3 download pip
    Collecting pip
    Using cached https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl
    Saved ./pip-19.1.1-py2.py3-none-any.whl
    Successfully downloaded pip

    $ sudo mv pip-19.1.1-py2.py3-none-any.whl /usr/share/python-wheels
    $ sudo mkdir /usr/share/python-wheels/old
    $ sudo mv /usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl /usr/share/python-wheels/old/

    $ cd ~/Projects/MyProject
    $ python3 -m venv venv
    $ source venv/bin/activate
    $ pip --version
    pip 19.1.1

    TADAAAA !!!

    June 26, 2019 at 2:43:00 PM GMT+2 * - permalink -
    QRCode
    - https://powerjpm.info/liens/shaare/pIj0Eg
    python pip update ubuntu
Links per page: 20 50 100
Shaarli - The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community - Help/documentation