pythonpippipx

Install arbitrary extra dependencies into environment used by a pipx installed tool


I've installed codespell using pipx:

pipx install codespell

and I would like to use the chardet option. However, chardet does not come with codespell by default so codespell errors.

How do I add chardet into the codespell environment that pipx created?

I tried

pipx install codespell chardet

but that didn't work.


Solution

  • The right syntax to use to add additional dependencies into an existing tool's environment is inject:

    pipx inject codespell chardet
    

    where codespell is the name of the existing tool's installation and chardet is the extra dependency I'd like to add. One can specify multiple extra dependencies in the same line:

    pipx inject package dependency1 dependency2 ...