Coder Social home page Coder Social logo

pipx-in-pipx's Introduction

pipx-in-pipx

Latest Version Supported Python Versions Code style: black
docs read-the-docs Documentation Status
tests static analysis Static Analysis
tests all tests Tests

pipx is great for keeping your CLI tools isolated and your system Python paths clean. However, it still requires that you install pipx itself in your system Python.

But pipx is a CLI tool installed through pip...why not install pipx with pipx? Why not indeed!

With pipx-in-pipx, all you need to do is install :

$ pip install pipx-in-pipx

But wait! You say. Didn't you just say that we shouldn't install things to system Python?

Yes. What pipx-in-pipx actually does is slightly (but only slightly) evil. Rather than actually installing anything when you run "install", pipx-in-pipx instead builds a temporary virtual environment, installs pipx there, and then uses that pipx to install pipx in your user local space, just like any other pipx-installed tool.

What you end up with is a pipx installation that is itself managed by pipx.

Sharp Edges

Which Python?

By default, pipx uses its own Python for each environment that it creates. This is whatever you used when you installed pipx. This is most commonly the system Python, but if you use pipx-in-pipx to install your pipx, it is the Python binary in the pipx-managed virtualenv for pipx. This, in turn, points to the Python that you used to install pipx-in-pipx.

This has a few notable side effects:

  1. If you uninstall your pipx-managed pipx (pipx uninstall pipx), all of the tools that you installed using that pipx will stop working because their Pythons suddenly point to nothing.
    • If you do this, you can fix it by installing pipx-in-pipx again.
  2. If you reinstall all pipx packages (pipx reinstall-all), this uninstalls your pipx-managed pipx.
    • If you do this, you can fix it by installing pipx-in-pipx again.
    • If you want to reinstall all other packages, tell pipx to ignore pipx (pipx reinstall-all --skip pipx).
    • To reinstall pipx, install pipx-in-pipx again.
  3. Because all pipx-managed packages use the Python in the pipx virtualenv, you can change the Python for all packages by installing pipx-in-pipx again.

Uninstalling

pipx has a handy feature to uninstall all pipx-managed tools. Because you have now made pipx manage itself, running pipx uninstall-all will also uninstall pipx.

This is not a bug, but a feature. By installing pipx using pipx-in-pipx, you have expressed an intent that you want pipx to manage itself. If that's not what you want, this is not the tool for you.

If you at any point uninstall your pipx-managed pipx, you can simply pip install pipx-in-pipx again to rebuild it.

pipx-in-pipx's People

Contributors

mattsb42 avatar mattsb42-aws avatar mintchkin avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.