Code Monkey home page Code Monkey logo

pipx's Introduction

pipx — Install and Run Python Applications in Isolated Environments

image PyPI version

Documentation: https://pipx.pypa.io

Source Code: https://github.com/pypa/pipx

For comparison to other tools including pipsi, see Comparison to Other Tools.

Install pipx

Warning

It is not recommended to install pipx via pipx. If you'd like to do this anyway, take a look at the pipx-in-pipx project and read about the limitations there.

On macOS

brew install pipx
pipx ensurepath
sudo pipx ensurepath --global # optional to allow pipx actions with --global argument

Upgrade pipx with brew update && brew upgrade pipx.

On Linux

  • Ubuntu 23.04 or above
sudo apt update
sudo apt install pipx
pipx ensurepath
sudo pipx ensurepath --global # optional to allow pipx actions with --global argument
  • Fedora:
sudo dnf install pipx
pipx ensurepath
sudo pipx ensurepath --global # optional to allow pipx actions with --global argument
  • Using pip on other distributions:
python3 -m pip install --user pipx
python3 -m pipx ensurepath
sudo pipx ensurepath --global # optional to allow pipx actions with --global argument

Upgrade pipx with python3 -m pip install --user --upgrade pipx.

On Windows

scoop install pipx
pipx ensurepath

Upgrade pipx with scoop update pipx.

  • install via pip (requires pip 19.0 or later)
# If you installed python using Microsoft Store, replace `py` with `python3` in the next line.
py -m pip install --user pipx

It is possible (even most likely) the above finishes with a WARNING looking similar to this:

WARNING: The script pipx.exe is installed in `<USER folder>\AppData\Roaming\Python\Python3x\Scripts` which is not on PATH

If so, go to the mentioned folder, allowing you to run the pipx executable directly. Enter the following line (even if you did not get the warning):

.\pipx.exe ensurepath

This will add both the above mentioned path and the %USERPROFILE%\.local\bin folder to your search path. Restart your terminal session and verify pipx does run.

Upgrade pipx with py -m pip install --user --upgrade pipx.

Using pipx without installing (via zipapp)

You can also use pipx without installing it. The zipapp can be downloaded from Github releases and you can invoke it with a Python 3.7+ interpreter:

python pipx.pyz ensurepath

Use with pre-commit

pipx has pre-commit support.

Shell completions

Shell completions are available by following the instructions printed with this command:

pipx completions

For more details, see the installation instructions.

Overview: What is pipx?

pipx is a tool to help you install and run end-user applications written in Python. It's roughly similar to macOS's brew, JavaScript's npx, and Linux's apt.

It's closely related to pip. In fact, it uses pip, but is focused on installing and managing Python packages that can be run from the command line directly as applications.

How is it Different from pip?

pip is a general-purpose package installer for both libraries and apps with no environment isolation. pipx is made specifically for application installation, as it adds isolation yet still makes the apps available in your shell: pipx creates an isolated environment for each application and its associated packages.

pipx does not ship with pip, but installing it is often an important part of bootstrapping your system.

Where Does pipx Install Apps From?

By default, pipx uses the same package index as pip, PyPI. pipx can also install from all other sources pip can, such as a local directory, wheel, git url, etc.

Python and PyPI allow developers to distribute code with "console script entry points". These entry points let users call into Python code from the command line, effectively acting like standalone applications.

pipx is a tool to install and run any of these thousands of application-containing packages in a safe, convenient, and reliable way. In a way, it turns Python Package Index (PyPI) into a big app store for Python applications. Not all Python packages have entry points, but many do.

If you would like to make your package compatible with pipx, all you need to do is add a console scripts entry point. If you're a poetry user, use these instructions. Or, if you're using hatch, try this.

Features

pipx enables you to

  • Expose CLI entrypoints of packages ("apps") installed to isolated environments with the install command. This guarantees no dependency conflicts and clean uninstalls!
  • Easily list, upgrade, and uninstall packages that were installed with pipx
  • Run the latest version of a Python application in a temporary environment with the run command

Best of all, pipx runs with regular user permissions, never calling sudo pip install (you aren't doing that, are you? 😄).

Walkthrough: Installing a Package and its Applications With pipx

You can globally install an application by running

pipx install PACKAGE

This automatically creates a virtual environment, installs the package, and adds the package's associated applications (entry points) to a location on your PATH. For example, pipx install pycowsay makes the pycowsay command available globally, but sandboxes the pycowsay package in its own virtual environment. pipx never needs to run as sudo to do this.

Example:

>> pipx install pycowsay
  installed package pycowsay 2.0.3, Python 3.7.3
  These apps are now globally available
    - pycowsay
done! ✨ 🌟 ✨


>> pipx list
venvs are in /home/user/.local/share/pipx/venvs
apps are exposed on your $PATH at /home/user/.local/bin
   package pycowsay 2.0.3, Python 3.7.3
    - pycowsay


# Now you can run pycowsay from anywhere
>> pycowsay mooo
  ____
< mooo >
  ====
         \
          \
            ^__^
            (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Installing from Source Control

You can also install from a git repository. Here, black is used as an example.

pipx install git+https://github.com/psf/black.git
pipx install git+https://github.com/psf/black.git@branch  # branch of your choice
pipx install git+https://github.com/psf/black.git@ce14fa8b497bae2b50ec48b3bd7022573a59cdb1  # git hash
pipx install https://github.com/psf/black/archive/18.9b0.zip  # install a release

The pip syntax with egg must be used when installing extras:

pipx install "git+https://github.com/psf/black.git#egg=black[jupyter]"

Inject a package

If an application installed by pipx requires additional packages, you can add them with pipx inject. For example, if you have ipython installed and want to add the matplotlib package to it, you would use:

pipx inject ipython matplotlib

Walkthrough: Running an Application in a Temporary Virtual Environment

This is an alternative to pipx install.

pipx run downloads and runs the above mentioned Python "apps" in a one-time, temporary environment, leaving your system untouched afterwards.

This can be handy when you need to run the latest version of an app, but don't necessarily want it installed on your computer.

You may want to do this when you are initializing a new project and want to set up the right directory structure, when you want to view the help text of an application, or if you simply want to run an app in a one-off case and leave your system untouched afterwards.

For example, the blog post How to set up a perfect Python project uses pipx run to kickstart a new project with cookiecutter, a tool that creates projects from project templates.

A nice side benefit is that you don't have to remember to upgrade the app since pipx run will automatically run a recent version for you.

Okay, let's see what this looks like in practice!

pipx run APP [ARGS...]

This will install the package in an isolated, temporary directory and invoke the app. Give it a try:

> pipx run pycowsay moo

  ---
< moo >
  ---
   \   ^__^
    \  (oo)\_______
       (__)\       )\/\
           ||----w |
           ||     ||


Notice that you don't need to execute any install commands to run the app.

Any arguments after the application name will be passed directly to the application:

> pipx run pycowsay these arguments are all passed to pycowsay!

  -------------------------------------------
< these arguments are all passed to pycowsay! >
  -------------------------------------------
   \   ^__^
    \  (oo)\_______
       (__)\       )\/\
           ||----w |
           ||     ||

Ambiguous arguments

Sometimes pipx can consume arguments provided for the application:

> pipx run pycowsay --py

usage: pipx run [-h] [--no-cache] [--pypackages] [--spec SPEC] [--verbose] [--python PYTHON]
                [--system-site-packages] [--index-url INDEX_URL] [--editable] [--pip-args PIP_ARGS]
                app ...
pipx run: error: ambiguous option: --py could match --pypackages, --python

To prevent this put double dash -- before APP. It will make pipx to forward the arguments to the right verbatim to the application:

> pipx run -- pycowsay --py


  ----
< --py >
  ----
   \   ^__^
    \  (oo)\_______
       (__)\       )\/\
           ||----w |
           ||     ||


Re-running the same app is quick because pipx caches Virtual Environments on a per-app basis. The caches only last a few days, and when they expire, pipx will again use the latest version of the package. This way you can be sure you're always running a new version of the package without having to manually upgrade.

Package with multiple apps, or the app name doesn't match the package name

If the app name does not match the package name, you can use the --spec argument to specify the PACKAGE name, and provide the APP to run separately:

pipx run --spec PACKAGE APP

For example, the esptool package doesn't provide an executable with the same name:

>> pipx run esptool
'esptool' executable script not found in package 'esptool'.
Available executable scripts:
    esp_rfc2217_server.py - usage: 'pipx run --spec esptool esp_rfc2217_server.py [arguments?]'
    espefuse.py - usage: 'pipx run --spec esptool espefuse.py [arguments?]'
    espsecure.py - usage: 'pipx run --spec esptool espsecure.py [arguments?]'
    esptool.py - usage: 'pipx run --spec esptool esptool.py [arguments?]'

You can instead run the executables that this package provides by using --spec:

pipx run --spec esptool esp_rfc2217_server.py
pipx run --spec esptool espefuse.py
pipx run --spec esptool espsecure.py
pipx run --spec esptool esptool.py

Note that the .py extension is not something you append to the executable name. It is part of the executable name, as provided by the package. This can be anything. For example, when working with the pymodbus package:

>> pipx run pymodbus[repl]
'pymodbus' executable script not found in package 'pymodbus'.
Available executable scripts:
    pymodbus.console - usage: 'pipx run --spec pymodbus pymodbus.console [arguments?]'
    pymodbus.server - usage: 'pipx run --spec pymodbus pymodbus.server [arguments?]'
    pymodbus.simulator - usage: 'pipx run --spec pymodbus pymodbus.simulator [arguments?]'

You can run the executables like this:

pipx run --spec pymodbus[repl] pymodbus.console
pipx run --spec pymodbus[repl] pymodbus.server
pipx run --spec pymodbus[repl] pymodbus.simulator

Running a specific version of a package

The PACKAGE argument above is actually a requirement specifier. Therefore, you can also specify specific versions, version ranges, or extras. For example:

pipx run mpremote==1.20.0
pipx run --spec esptool==4.6.2 esptool.py
pipx run --spec 'esptool>=4.5' esptool.py
pipx run --spec 'esptool >= 4.5' esptool.py

Notice that some requirement specifiers have to be enclosed in quotes or escaped.

Running from Source Control

You can also run from a git repository. Here, black is used as an example.

pipx run --spec git+https://github.com/psf/black.git black
pipx run --spec git+https://github.com/psf/black.git@branch black  # branch of your choice
pipx run --spec git+https://github.com/psf/black.git@ce14fa8b497bae2b50ec48b3bd7022573a59cdb1 black  # git hash
pipx run --spec https://github.com/psf/black/archive/18.9b0.zip black # install a release

Running from URL

You can run .py files directly, too.

pipx run https://gist.githubusercontent.com/cs01/fa721a17a326e551ede048c5088f9e0f/raw/6bdfbb6e9c1132b1c38fdd2f195d4a24c540c324/pipx-demo.py
pipx is working!

Summary

That's it! Those are the most important commands pipx offers. To see all of pipx's documentation, run pipx --help or see the docs.

Testimonials

"Thanks for improving the workflow that pipsi has covered in the past. Nicely done!"
Jannis Leidel, PSF fellow, former pip and Django core developer, and founder of the Python Packaging Authority (PyPA)

"My setup pieces together pyenv, poetry, and pipx. [...] For the things I need, it’s perfect."

"I'm a big fan of pipx. I think pipx is super cool."
Michael Kennedy, co-host of PythonBytes podcast in episode 139

Credits

pipx was inspired by pipsi and npx. It was created by Chad Smith and has had lots of help from contributors. The logo was created by @IrishMorales.

pipx is maintained by a team of volunteers (in alphabetical order)

Contributing

Issues and Pull Requests are definitely welcome! Check out Contributing to get started. Everyone who interacts with the pipx project via codebase, issue tracker, chat rooms, or otherwise is expected to follow the PSF Code of Conduct.

pipx's People

Contributors

aljohri avatar backwardspy avatar cclauss avatar chrahunt avatar chrysle avatar cs01 avatar dependabot[bot] avatar dukecat0 avatar gaborbernat avatar gitznik avatar guahki avatar henryiii avatar huxuan avatar itsayellow avatar jackenmen avatar maxwell-k avatar mayeut avatar ofek avatar pawamoy avatar pfmoore avatar potiuk avatar pre-commit-ci[bot] avatar sahensley avatar sgryjp avatar spazm avatar spitfire1900 avatar stefanor avatar tkossak avatar tusharsadhwani avatar uranusjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pipx's Issues

pipx inject binary

pipx inject is great for adding an additional dependency, but what about adding an additional binary?

For instance, I use beancount and there is an optional web interface package fava. pipx install beancount; pipx inject beancount fava worked to install the fava package, but didn't symlink the binary.

Perhaps this functionality could be added to pipx inject? I'm not sure if it should be by default or as an option pipx inject --link-binaries, but either would work for me.

Problem when install from git branch + poetry

When I try to install from a git branch of a project which uses poetry (i.e. no setuptools), pipx chokes because there is no setup.py. E.g. This is the traceback for installing the develop branch of poetry itself

pipx install --spec 'git+https://github.com/sdispater/poetry.git@develop' poetry --verbose
pipx (run_pipx_command:626): virtualenv location is /home/feanor/.local/pipx/venvs/poetry
pipx (_run:230): running /usr/bin/python -m venv /home/feanor/.local/pipx/venvs/poetry
pipx (_run:230): running /home/feanor/.local/pipx/venvs/poetry/bin/python -m pip install --upgrade pip
Looking in links: /home/feanor/.wheelhouse
Collecting pip
  Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 10.0.1
    Uninstalling pip-10.0.1:
      Successfully uninstalled pip-10.0.1
Successfully installed pip-18.1
pipx (_run:230): running /home/feanor/.local/pipx/venvs/poetry/bin/python -m pip install git+https://github.com/sdispater/poetry.git@develop#egg=poetry
Looking in links: /home/feanor/.wheelhouse
Collecting poetry from git+https://github.com/sdispater/poetry.git@develop#egg=poetry
  Cloning https://github.com/sdispater/poetry.git (to revision develop) to ./feanor/pip-install-xsy609ai/poetry
Branch 'develop' set up to track remote branch 'develop' from 'origin'.
Switched to a new branch 'develop'
  Installing build dependencies ... done
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.7/tokenize.py", line 447, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/feanor/pip-install-xsy609ai/poetry/setup.py'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/feanor/pip-install-xsy609ai/poetry/
pipx (rmdir:240): removing directory /home/feanor/.local/pipx/venvs/poetry
'/home/feanor/.local/pipx/venvs/poetry/bin/python -m pip install git+https://github.com/sdispater/poetry.git@develop#egg=poetry' failed

I am not sure if this is something under the scope of pipx, but at the very least handling the exception and giving a message should be better from a UX point of view.

should `--verbose` be default?

I think --verbose should be the default option. When you execute for example pipx install borgbackup (or whatever that takes a bit longer) and you wait a while for anything to happen, you start wondering if pipx froze. Some feedback that something IS happening (and what) would be nice, before somebody tries to kill the process.

pipx 0.0.0.13

Migration from pipsi

I know pipx itself does not provide a way to migrate, but it's actually pretty easy to do it on the command-line, so maybe a note in the README/docs/wiki could be nice:

# install pipx
curl https://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py | python3

# migrate
pipsi list | \
  grep 'Package ' | \
  cut -d\" -f2 | \
  while read -r p; do
    # uninstall
    pipsi uninstall --yes "$p"

    # and hope everything works with python 3.6
    # more complex instructions could read the python version from the bin files
    pipx install --python python3.6 "$p"
  done

# clean up
rm -rf ~/.local/pipsi
rm ~/.local/bin/pipsi

pipx is impacted by current dir?

When I run pipx in one of my directories (Python project), pipx outputs some error messages about dependencies, when it should not:

$ pipx ipython
⚠️  ipython is already on your PATH and installed at /home/pawamoy/.local/bin/ipython. Downloading and running anyway.
aria2p 0.1.0 requires requests, which is not installed.
Python 3.6.7 (default, Dec 11 2018, 20:49:24) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: 

The error message above is aria2p 0.1.0 requires requests, which is not installed. written in red. I ran this command in my aria2p Python project directory. Is pipx reading things in pyproject.toml / poetry.lock / *.egg-info / dist/ ? I really don't understand what pipx is doing here that causes it to output this message 😄

Usage string is incorrect

The usage string appears to always list every possible subcommand, even when viewing help for a specific subcommand.

eg:

$ pipx install --help
usage: pipx [--spec SPEC] [--python PYTHON] BINARY [BINARY-ARGS]
    pipx {install, upgrade, upgrade-all, uninstall, uninstall-all, reinstall-all, list} [--help] install
       [-h] [--spec SPEC] [--verbose] [--python PYTHON] package

positional arguments:
  package          package name
...
$ pipx --help
usage:
    pipx [--spec SPEC] [--python PYTHON] BINARY [BINARY-ARGS]
    pipx {install, upgrade, upgrade-all, uninstall, uninstall-all, reinstall-all, list} [--help]
...
positional arguments:
  binary           A Python package's binary to run or the pipx command to
                   run. If binary,the PyPI package is assumed to have the same
                   name.
...

installation failure in travis-ci

1.45s$ curl https://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py | python
Installing pipx
Traceback (most recent call last):
  File "<stdin>", line 231, in <module>
  File "<stdin>", line 215, in main
  File "<stdin>", line 136, in install
  File "<stdin>", line 52, in create_venv
  File "<stdin>", line 64, in upgrade_package
  File "<stdin>", line 70, in _run_pip
  File "<stdin>", line 36, in _run
  File "/opt/python/3.6.3/lib/python3.6/subprocess.py", line 403, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/opt/python/3.6.3/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/opt/python/3.6.3/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: PosixPath('/home/travis/.local/pipx/venvs/pipx/bin/pip'): PosixPath('/home/travis/.local/pipx/venvs/pipx/bin/pip')

I suspect get-pipx.py probably needs to use https://docs.python.org/3/library/os.html#os.makedirs somewhere to ensure that the full path exists.

For reference, the WIP travis config in my PR in my project - https://github.com/guykisel/inline-plz/blob/8956751a942ce3088fbb81a563d63d8aa545073f/.travis.yml

blackd

hi,
pipx install black does not install aiohttp needed by blackd.

how do you deal with it ?

nice tool.
Jimmy

Cannot install mssql-cli

I don't know if this is something with my setup or what but if I run

pip install mssql-cli

and then run mssql-cli --version then everything is fine. On the other hand if i run

pip uninstall mssql-cli
pipx install mssql-cli

and re-run mssql-cli --version I get

/usr/bin/python: Error while finding module specification for 'mssqlcli.main' (ModuleNotFoundError: No module named 'mssqlcli')

I'm using python 3.7. Thanks in advance for looking into this.

Pipx uninstall deletes python3 symlink

Environment Details

I use Pyenv to build my Python distributions then I create a symlink to the binary in ~/.local/bin (which is in $PATH) instead of using the shims.

For example, I have this symlink in my ~/.local/bin directory:

python3 -> /Users/username/.pyenv/versions/3.6.6/bin/python3.6

Here's the output of pipx list after an install with the default settings:

venvs are in /Users/username/.local/pipx/venvs, symlinks to binaries are in /Users/username/.local/bin
package pipx 0.0.0.9, symlinks to binaries available: python3, pipx

Issue

The issue occurs when I run pipx uninstall package. The command will complete successfully but it also deletes the ~/.local/bin/python3 symlink, which breaks pipx itself and any packages installed.

How to install a release version ?

I'd like to install a tagged, release version of say https://github.com/pimutils/khal.
I know I how to install certain branches, but khal doesn't have a branch per tag/release.

This fails:

 ~  pipx install --spec git+https://github.com/pimutils/[email protected]  khal
  Did not find branch or tag '0.9.9', assuming revision or ref.
error: pathspec '0.9.9' did not match any file(s) known to git
Command "git checkout -q 0.9.9" failed with error code 1 in /tmp/pip-install-lve2n4x8/khal
'/home/varac/.local/pipx/venvs/khal/bin/pip install git+https://github.com/pimutils/[email protected]#egg=khal -q' failed

add pipx as an installation method for projects

If you are an owner of a project or have a favorite project that is suited to be run by pipx, add instructions to the project's README.

Let’s make pipx as ubiquitous as pip for python package installation!

Example installation text

This package can be installed and run from a temporary virtual environment with no commitment by running pipx run BINARY

This package can be globally installed using pipx, the Python binary runner.

pipx install PACKAGE

and run directly from the command line

BINARY

Support passing --index-url to pip install command

In writing this, it turns out I can do pipx install --spec https://custompypi.com/api/pypi/pypi/packages/examplepackage/1.0.0 binary, but it'd be nice if the interface was more normal to how installation would typically work

pipx install --index-url https://custompypi.com/api/pypi/pypi/simple binary
pipx install --index-url https://custompypi.com/api/pypi/pypi/simple --spec examplepackage==1.0.0 binary

Moving from pipsi?

Is there a guide on how to move your binaries to pipx after using pipsi?

pipx list readability

pipx list readability could be improved, see this:

> pipx list
venvs are in /home/kossak/.local/pipx/venvs, symlinks to binaries are in /home/kossak/.local/bin
package black 18.9b0, symlinks to binaries available: black, blackd
package kossak_cli_tools 0.4.0, symlinks to binaries available: ytrss, capslock_as_escape, countfiles, replacepolishletters, checkeng, fix_double_new_lines, countaudio, capslock_restore, countextensions, ou, e
package pipx 0.0.0.11, symlinks to binaries available: pipx

It could be cleaner, like:

venvs are in /home/kossak/.local/pipx/venvs, symlinks to binaries are in /home/kossak/.local/bin
  Package "kossak_cli_tools" 0.4.0:
    - capslock_as_escape
    - capslock_restore
    - checkeng
    - countaudio
    - countextensions
    - countfiles
    - e
    - fix_double_new_lines
    - ou
    - replacepolishletters
    - ytrss
  Package "black" 19.9b0:
    - black
    - etc...

Don't reinstall if already installed

Hi! I if a binary is already installed, such as black, and I run:

pipx install black --verbose

this will reinstall black. Can this be avoid and instead give a message saying "Black is already installed, nothing to do" or something like that. Thanks!

Package renamed to pipx-app in v0.10.0. Users of < 0.10 must re-install.

As suggested in #2, pipx's package name was changed to pipx-app to avoid the name conflict with another project named pipx.

Thus pipx users who have already installed this pipx package with a version less than 0.10 will need to uninstall it and all its packages, then re-install everything. (This is due to path assumptions made by pipx based on package name; it assumes the virtual env's name matches the package's name.)

The end-user experience will be identical (you can still just call pipx from the command line), but some of the paths pipx uses behind the scenes will be changed.

pipx uninstall-all
curl https://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py | python3
# reinstall packages

This was a one-time rename. Thank you for your understanding!

EDIT: changed from pipx uninstall pipx to pipx uninstall-all

Consider lowing Python version requirements

Hey, I recently attempted to use pipx on a Debian stretch system, which is still on Python 3.5.
As such, Python 3.5 support would be nice to have in pipx. As far as I can tell, the only feature that requires 3.6 that pipx requires is PEP 498 (literal string interpolation).

Would you be willing to use string.format() over PEP 498 strings?

Install flake8 from git

I'm trying to install flake8 from git like so:

> pipx install --spec git+https://github.com/PyCQA/flake8 flake8 --verbose
pipx (run_pipx_command:384): virtualenv location is /home/pedro/.local/pipx/venvs/flake8
pipx (_run:170): running /home/pedro/.local/pipx/venvs/flake8/bin/pip install git+https://github.com/PyCQA/flake8#egg=flake8
Collecting flake8 from git+https://github.com/PyCQA/flake8#egg=flake8
  Cloning https://github.com/PyCQA/flake8 to /tmp/pip-install-lgz1be58/flake8
Collecting pyflakes<2.1.0,>=2.0.0 (from flake8)
  Using cached https://files.pythonhosted.org/packages/44/98/af7a72c9a543b1487d92813c648cb9b9adfbc96faef5455d60f4439aa99b/pyflakes-2.0.0-py2.py3-none-any.whl
Collecting pycodestyle<2.5.0,>=2.4.0 (from flake8)
  Using cached https://files.pythonhosted.org/packages/e5/c6/ce130213489969aa58610042dff1d908c25c731c9575af6935c2dfad03aa/pycodestyle-2.4.0-py2.py3-none-any.whl
Collecting mccabe<0.7.0,>=0.6.0 (from flake8)
  Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=30 in ./.local/pipx/venvs/flake8/lib/python3.7/site-packages (from flake8) (39.0.1)
Installing collected packages: pyflakes, pycodestyle, mccabe, flake8
  Running setup.py install for flake8 ... done
Successfully installed flake8-3.5.0 mccabe-0.6.1 pycodestyle-2.4.0 pyflakes-2.0.0
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
pipx (rmdir:178): removing directory /home/pedro/.local/pipx/venvs/flake8
No binaries associated with this package

What's the correct way of doing this? Thanks!

Expected to find pip at /home/<user>/.local/pipx/venvs/<pkg>/bin/pip

Hi, I just installed pipx using:

curl -sL https://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py | PYENV_VERSION=system python3

I'm my system Python 3 is 3.7.0 in case that matters, and I'm also using Pyenv.

When I install packages pipx install <pkg>, I get the following error:

Expected to find pip at /home/<user>/.local/pipx/venvs/<pkg>/bin/pip

pipx install ansible - No binaries associated with this package.

First off, thanks again for making pipx!

Installing Ansible with pipx fails with "no binaries associated with this package".

Ansible is packaged in a fairly unique manner, as can be seen in the setup.py file and examining the bin folder. The main binary is ansible and other functionality such as ansible-playbook is a symlink to ansible.

I wouldn't expect this to be a quick fix but I did want to note this in an issue.

re-use/cache virtualenv when running in ephemeral environment

Currently running something like

pipx cowsay Moo 1

then

pipx cowsay Moo 2

results in sort of a long delay each time pipx is invoked because a virtualenv is created and then pip is upgraded before installing cowsay.

To make this faster, pipx could not delete the virtual env after exiting and just re-use it. A new argument --force-new-venv will be added to force use of a completely new venv if the user does not want to use the cache.

can pipx install from local folder/whl/tar.gz?

Is it possible to install package (with all its entry points) that exists only on my hard drive?

pipx install '/tmp/3/kossak_cli_tools'
Traceback (most recent call last):
  File "/home/kossak/.local/bin/pipx", line 11, in <module>
    load_entry_point('pipx==0.0.0.5', 'console_scripts', 'pipx')()
  File "/home/kossak/.local/pipx/venvs/pipx/lib/python3.6/site-packages/pipx/main.py", line 567, in cli
    run_pipx_command(args)
  File "/home/kossak/.local/pipx/venvs/pipx/lib/python3.6/site-packages/pipx/main.py", line 358, in run_pipx_command
    install(venv_dir, package, package_or_url, local_bin_dir, args.python, verbose)
  File "/home/kossak/.local/pipx/venvs/pipx/lib/python3.6/site-packages/pipx/main.py", line 277, in install
    venv.install_package(package_or_url)
  File "/home/kossak/.local/pipx/venvs/pipx/lib/python3.6/site-packages/pipx/main.py", line 78, in install_package
    self._run_pip(["install", package_or_url])
  File "/home/kossak/.local/pipx/venvs/pipx/lib/python3.6/site-packages/pipx/main.py", line 145, in _run_pip
    return _run(cmd)
  File "/home/kossak/.local/pipx/venvs/pipx/lib/python3.6/site-packages/pipx/main.py", line 151, in _run
    returncode = subprocess.run(cmd).returncode
  File "/home/kossak/.asdf/installs/python/3.6.6/lib/python3.6/subprocess.py", line 403, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/home/kossak/.asdf/installs/python/3.6.6/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/home/kossak/.asdf/installs/python/3.6.6/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: PosixPath('/tmp/3/kossak_cli_tools/bin/pip'): PosixPath('/tmp/3/kossak_cli_tools/bin/pip')

I can do it using pipsi with pipsi install '/tmp/3/kossak_cli_tools' and it processes the setup.py from this folder properly.

`pipx list` readbility

pipx list readability could be improved, see this:

> pipx list
venvs are in /home/kossak/.local/pipx/venvs, symlinks to binaries are in /home/kossak/.local/bin
package black 18.9b0, symlinks to binaries available: black, blackd
package kossak_cli_tools 0.4.0, symlinks to binaries available: ytrss, capslock_as_escape, countfiles, replacepolishletters, checkeng, fix_double_new_lines, countaudio, capslock_restore, countextensions, ou, e
package pipx 0.0.0.11, symlinks to binaries available: pipx

It could be cleaner, like:

venvs are in /home/kossak/.local/pipx/venvs, symlinks to binaries are in /home/kossak/.local/bin
  Package "kossak_cli_tools" 0.4.0:
    - capslock_as_escape
    - capslock_restore
    - checkeng
    - countaudio
    - countextensions
    - countfiles
    - e
    - fix_double_new_lines
    - ou
    - replacepolishletters
    - ytrss
  Package "black" 19.9b0:
    - black
    - etc...

`pipx` name on PyPI is taken by another project

I spoke with the owner of the `pipx` name on PyPI about transferring ownership to this project, and he said he would do so only if it was popular enough.

Add a thumbs up to this issue to signal to the owner that you would like this project to be transferred as the owner of the name on PyPI.

  • npx is the node package runner, so for symmetry it makes sense that pipx would be the Python package runner
  • if ownership was transferred, I would add a section in the README thanking him and linking to his github projects

thank you for all the upvotes!

Update: The owner of the pipx name is going to keep the name. This issue is now to determine the best way forward in terms of installing pipx and choosing a name (if any) on PyPI.

Need option '--editable' for pipx-install

I recently switched to pipx from pipsi. So far, it is reliable and intuitive, love it.

Is there an equivalent to 'pipsi install --editable'? If not, IMO, it'd be a great addition.

homebrew?

would you consider making a homebrew formula? that might make installation simpler on macOS. a homebrew formula for a python app will be contained within its own virtualenv

UnicodeEncodeError trying to install pipx to docker container

I'm trying to install pipx into a centos-based docker container. I'm getting an odd error. I'm still poking around myself to try to understand this, but figured I'd also report here in case this is a known issue with a known solution :)

Step 83/83 : RUN curl https://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py | python3.6
 ---> Running in 1c48d64c3bc3
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  6918  100  6918    0     0  24853      0 --:--:-- --:--:-- --:--:-- 24884
Installing pipx
Traceback (most recent call last):
  File "<stdin>", line 231, in <module>
  File "<stdin>", line 228, in main
UnicodeEncodeError: 'ascii' codec can't encode character '\u2728' in position 7: ordinal not in range(128)

============================================================

Note:
  To finish installation, /root/.local/bin must be added to your PATH.
  This can be done by adding the following line to your shell
  config file:

  export PATH=/root/.local/bin:$PATH

============================================================


Now that pipx is installed, we suggest you run one of these commands.

  pipx BINARY [BINARY ARGS ...] #  i.e. pipx cowsay moo

  pipx install PACKAGE  # i.e. pipx install cowsay

  pipx --help  # to see options

Questions or comments? See https://github.com/cs01/pipx
The command '/bin/sh -c curl https://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py | python3.6' returned a non-zero code: 1

upgrade libraries only if really needed or change debug message

Hi,
I'm really enjoying pipx. I have a question though which I don't know if it's a bug or just wrong logging. When I run pipx upgrade-all --verbose I get the following output:

pipx (_run:170): running /home/pedro/.local/pipx/venvs/jupyter-core/bin/pip install --upgrade jupyter-core
Requirement already up-to-date: jupyter-core in ./.local/pipx/venvs/jupyter-core/lib/python3.7/site-packages (4.4.0)
Requirement already satisfied, skipping upgrade: traitlets in ./.local/pipx/venvs/jupyter-core/lib/python3.7/site-packages (from jupyter-core) (4.3.2)
Requirement already satisfied, skipping upgrade: ipython-genutils in ./.local/pipx/venvs/jupyter-core/lib/python3.7/site-packages (from traitlets->jupyter-core) (0.2.0)
Requirement already satisfied, skipping upgrade: six in ./.local/pipx/venvs/jupyter-core/lib/python3.7/site-packages (from traitlets->jupyter-core) (1.11.0)
Requirement already satisfied, skipping upgrade: decorator in ./.local/pipx/venvs/jupyter-core/lib/python3.7/site-packages (from traitlets->jupyter-core) (4.3.0)
pipx (symlink_package_binaries:211): ⚠️  jupyter-troubleshoot is already on your PATH at /home/pedro/.local/pipx/venvs/jupyter-core/bin/jupyter-troubleshoot. Not creating new symlink at /home/pedro/.local/bin/jupyter-troubleshoot
pipx (symlink_package_binaries:211): ⚠️  jupyter is already on your PATH at /home/pedro/.local/pipx/venvs/jupyter-core/bin/jupyter. Not creating new symlink at /home/pedro/.local/bin/jupyter
pipx (symlink_package_binaries:211): ⚠️  jupyter-migrate is already on your PATH at /home/pedro/.local/pipx/venvs/jupyter-core/bin/jupyter-migrate. Not creating new symlink at /home/pedro/.local/bin/jupyter-migrate
upgraded package jupyter-core to latest version (location: /home/pedro/.local/pipx/venvs/jupyter-core)
pipx (_run:170): running /home/pedro/.local/pipx/venvs/ipython/bin/pip install --upgrade ipython
Requirement already up-to-date: ipython in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (7.0.1)
Requirement already satisfied, skipping upgrade: prompt-toolkit<2.1.0,>=2.0.0 in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from ipython) (2.0.6)
Requirement already satisfied, skipping upgrade: backcall in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from ipython) (0.1.0)
Requirement already satisfied, skipping upgrade: setuptools>=18.5 in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from ipython) (39.0.1)
Requirement already satisfied, skipping upgrade: pickleshare in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from ipython) (0.7.5)
Requirement already satisfied, skipping upgrade: traitlets>=4.2 in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from ipython) (4.3.2)
Requirement already satisfied, skipping upgrade: pygments in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from ipython) (2.2.0)
Requirement already satisfied, skipping upgrade: jedi>=0.10 in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from ipython) (0.13.1)
Requirement already satisfied, skipping upgrade: simplegeneric>0.8 in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from ipython) (0.8.1)
Requirement already satisfied, skipping upgrade: decorator in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from ipython) (4.3.0)
Requirement already satisfied, skipping upgrade: pexpect; sys_platform != "win32" in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from ipython) (4.6.0)
Requirement already satisfied, skipping upgrade: wcwidth in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython) (0.1.7)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython) (1.11.0)
Requirement already satisfied, skipping upgrade: ipython-genutils in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from traitlets>=4.2->ipython) (0.2.0)
Requirement already satisfied, skipping upgrade: parso>=0.3.0 in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from jedi>=0.10->ipython) (0.3.1)
Requirement already satisfied, skipping upgrade: ptyprocess>=0.5 in ./.local/pipx/venvs/ipython/lib/python3.7/site-packages (from pexpect; sys_platform != "win32"->ipython) (0.6.0)
pipx (symlink_package_binaries:211): ⚠️  iptest is already on your PATH at /home/pedro/.local/pipx/venvs/ipython/bin/iptest. Not creating new symlink at /home/pedro/.local/bin/iptest
pipx (symlink_package_binaries:211): ⚠️  ipython is already on your PATH at /home/pedro/.local/pipx/venvs/ipython/bin/ipython. Not creating new symlink at /home/pedro/.local/bin/ipython
pipx (symlink_package_binaries:211): ⚠️  ipython3 is already on your PATH at /home/pedro/.local/pipx/venvs/ipython/bin/ipython3. Not creating new symlink at /home/pedro/.local/bin/ipython3
pipx (symlink_package_binaries:211): ⚠️  iptest3 is already on your PATH at /home/pedro/.local/pipx/venvs/ipython/bin/iptest3. Not creating new symlink at /home/pedro/.local/bin/iptest3
upgraded package ipython to latest version (location: /home/pedro/.local/pipx/venvs/ipython)
pipx (_run:170): running /home/pedro/.local/pipx/venvs/pgcli/bin/pip install --upgrade pgcli
Requirement already up-to-date: pgcli in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (2.0.0)
Requirement already satisfied, skipping upgrade: humanize>=0.5.1 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from pgcli) (0.5.1)
Requirement already satisfied, skipping upgrade: prompt-toolkit<2.1.0,>=2.0.0 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from pgcli) (2.0.6)
Requirement already satisfied, skipping upgrade: Pygments>=2.0 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from pgcli) (2.2.0)
Requirement already satisfied, skipping upgrade: psycopg2<2.8,>=2.7.4 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from pgcli) (2.7.5)
Requirement already satisfied, skipping upgrade: click>=4.1 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from pgcli) (7.0)
Requirement already satisfied, skipping upgrade: setproctitle>=1.1.9 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from pgcli) (1.1.10)
Requirement already satisfied, skipping upgrade: pgspecial>=1.11.2 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from pgcli) (1.11.2)
Requirement already satisfied, skipping upgrade: sqlparse<0.3.0,>=0.2.2 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from pgcli) (0.2.4)
Requirement already satisfied, skipping upgrade: configobj>=5.0.6 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from pgcli) (5.0.6)
Requirement already satisfied, skipping upgrade: cli-helpers[styles]>=1.0.1 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from pgcli) (1.1.0)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->pgcli) (1.11.0)
Requirement already satisfied, skipping upgrade: wcwidth in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->pgcli) (0.1.7)
Requirement already satisfied, skipping upgrade: tabulate[widechars]>=0.8.2 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from cli-helpers[styles]>=1.0.1->pgcli) (0.8.2)
Requirement already satisfied, skipping upgrade: terminaltables>=3.0.0 in ./.local/pipx/venvs/pgcli/lib/python3.7/site-packages (from cli-helpers[styles]>=1.0.1->pgcli) (3.1.0)
pipx (symlink_package_binaries:211): ⚠️  pgcli is already on your PATH at /home/pedro/.local/pipx/venvs/pgcli/bin/pgcli. Not creating new symlink at /home/pedro/.local/bin/pgcli
upgraded package pgcli to latest version (location: /home/pedro/.local/pipx/venvs/pgcli)
pipx (_run:170): running /home/pedro/.local/pipx/venvs/pipx/bin/pip install --upgrade git+https://github.com/cs01/pipx.git
Collecting git+https://github.com/cs01/pipx.git
  Cloning https://github.com/cs01/pipx.git to /tmp/pip-req-build-s_nbdr78
Requirement already satisfied, skipping upgrade: requests in ./.local/pipx/venvs/pipx/lib/python3.7/site-packages (from pipx==0.0.0.9) (2.20.0)
Requirement already satisfied, skipping upgrade: urllib3<1.25,>=1.21.1 in ./.local/pipx/venvs/pipx/lib/python3.7/site-packages (from requests->pipx==0.0.0.9) (1.24)
Requirement already satisfied, skipping upgrade: idna<2.8,>=2.5 in ./.local/pipx/venvs/pipx/lib/python3.7/site-packages (from requests->pipx==0.0.0.9) (2.7)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in ./.local/pipx/venvs/pipx/lib/python3.7/site-packages (from requests->pipx==0.0.0.9) (2018.10.15)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in ./.local/pipx/venvs/pipx/lib/python3.7/site-packages (from requests->pipx==0.0.0.9) (3.0.4)
Installing collected packages: pipx
  Found existing installation: pipx 0.0.0.9
    Uninstalling pipx-0.0.0.9:
      Successfully uninstalled pipx-0.0.0.9
  Running setup.py install for pipx ... done
Successfully installed pipx-0.0.0.9
upgraded package pipx to latest version (location: /home/pedro/.local/pipx/venvs/pipx)
pipx (_run:170): running /home/pedro/.local/pipx/venvs/mycli/bin/pip install --upgrade mycli
Requirement already up-to-date: mycli in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (1.18.0)
Requirement already satisfied, skipping upgrade: prompt-toolkit<1.1.0,>=1.0.10 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from mycli) (1.0.15)
Requirement already satisfied, skipping upgrade: Pygments>=1.6 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from mycli) (2.2.0)
Requirement already satisfied, skipping upgrade: configobj>=5.0.5 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from mycli) (5.0.6)
Requirement already satisfied, skipping upgrade: sqlparse<0.3.0,>=0.2.2 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from mycli) (0.2.4)
Requirement already satisfied, skipping upgrade: click>=4.1 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from mycli) (7.0)
Requirement already satisfied, skipping upgrade: cryptography>=1.0.0 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from mycli) (2.3.1)
Requirement already satisfied, skipping upgrade: cli-helpers[styles]>=1.0.1 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from mycli) (1.1.0)
Requirement already satisfied, skipping upgrade: PyMySQL>=0.9.2 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from mycli) (0.9.2)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from prompt-toolkit<1.1.0,>=1.0.10->mycli) (1.11.0)
Requirement already satisfied, skipping upgrade: wcwidth in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from prompt-toolkit<1.1.0,>=1.0.10->mycli) (0.1.7)
Requirement already satisfied, skipping upgrade: cffi!=1.11.3,>=1.7 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from cryptography>=1.0.0->mycli) (1.11.5)
Requirement already satisfied, skipping upgrade: idna>=2.1 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from cryptography>=1.0.0->mycli) (2.7)
Requirement already satisfied, skipping upgrade: asn1crypto>=0.21.0 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from cryptography>=1.0.0->mycli) (0.24.0)
Requirement already satisfied, skipping upgrade: terminaltables>=3.0.0 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from cli-helpers[styles]>=1.0.1->mycli) (3.1.0)
Requirement already satisfied, skipping upgrade: tabulate[widechars]>=0.8.2 in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from cli-helpers[styles]>=1.0.1->mycli) (0.8.2)
Requirement already satisfied, skipping upgrade: pycparser in ./.local/pipx/venvs/mycli/lib/python3.7/site-packages (from cffi!=1.11.3,>=1.7->cryptography>=1.0.0->mycli) (2.19)
pipx (symlink_package_binaries:211): ⚠️  mycli is already on your PATH at /home/pedro/.local/pipx/venvs/mycli/bin/mycli. Not creating new symlink at /home/pedro/.local/bin/mycli
upgraded package mycli to latest version (location: /home/pedro/.local/pipx/venvs/mycli)

I think the upgraded package mycli to latest version (location: /home/pedro/.local/pipx/venvs/mycli) is a bit misleading since there wasn't an actual update right? I don't know if that can be changed to something like "Already latest version... nothing to do.` Thanks!

Emojis don't work

Is there a global option to turn them off?

image

I use pipx 0.0.0.5 / fish 2.7.1 / tmux 2.8 / xfce4-terminal 0.8.7.4

Delay in upgrading?

$ pip search aria2p
aria2p (0.1.2)  - Command-line tool and library to interact with an aria2c daemon process with JSON-RPC.
  INSTALLED: 0.1.0
  LATEST:    0.1.2
$ pipx upgrade aria2p
aria2p is already at latest version 0.1.0 (location: /home/pawamoy/.local/pipx/venvs/aria2p)

Windows support?

It's not clear from the docs if pipx supports Windows, but given that it relies on symlinks, I assume not? (Symlinks typically require extra privileges on Windows, that the average user doesn't have). Are there plans to support Windows?

identify more binary definitions

It appears that currently pipx doesn't support installing packages that don't have a binary associated with them. One said tool that I used pipsi to install and would like to use pipx to install would be the awscli

[14:14:43] megger:~ $ pipx install awscli
No binaries associated with this package

Is there any plans to support this type of installation?

Allow adding files to the path even when already on the path

Right now, if you try to install a package already installed on the system, you get a message like this: flake8 is already on your PATH at /usr/bin/flake8. Not creating new symlink ... It should be possible (perhaps default?) to install the symlink any way (assuming there is no file at the symlink target already, other than a pipx symlink) because perhaps the package needs to be installed for the system but I want to put a newer version in front of it on my user's path. It is nice to show a warning, perhaps even checking after install if the installed version is first on the path.

Documentation wording

The README is misleading regarding what is added to the path:

The install command is the preferred way to globally install binaries from python packages on your system. It creates an isolated virtual environment for the package, then in a folder on your PATH creates symlinks to all the binaries in that virtual environment.

pipx does not create symlinks to all the binaries in the virtual environment, rather to all the binaries provided by the installed package (not any installed by its dependencies).

Also, I find the use of "binary" in the README misleading. Really, what are added to the path are executable files, typically Python scripts, not binary files.

Conda support?

Is there any way to support conda packages? I am guessing that "pipx for conda" is an easy analogy to make but in practice there would be little code re-use between the pip and conda versions. So I'm not saying this should be added to pipx, but I thought there could at least be a closed issue about conda in the issue tracker for future reference.

A conda equivalent would be nice to have. If anyone knows of one or writes one, link to it here for future reference.

Have pipx work independently of pyenv

I use pyenv to manage my python environments, but I like the ability to install executables in a sandbox using something like pipx.

I installed pipx using curl -sL https://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py | PYENV_VERSION=system python3

However, at run time it seems to pick up some environment setup from pyenv. This causes some issues, like not correctly adding pip to the venv.

There's a couple of workarounds: PYENV_VERSION=system pipx install <pkg> or pipx install --python /usr/bin/python3 <pkg>.

However, it'd be nice is pipx worked independent of the pyenv setup and just used the environment it was used to install itself (this is how pipsi seems to work currently).

Another issue with pyenv is that if you already have an executable installed in any of your pyenv managed environments, pyenv creates an executable shim in ~/.pyenv/shims/. When pipx sees that this already exists, it doesn't create the symlink in ~/.local/bin (because ~/.pyenv/shims/ is in $PATH)

Install additional dependencies for given CLI

python-language-server allows installing some additional features using extensions, e.g.:

$ pipx install python-language-server[all]
includes support for Rope, Pyflakes, McCabe, pycodestyle, pydocstyle, autopep8 and YAPF.

However, some plugins must be installed separately into given virtualenv:

  • pyls-mypy Mypy type checking for Python 3
  • pyls-isort Isort import sort code formatting
  • pyls-black for code formatting using Black

Question: Does pipx allow installing additional python packages into virtualenv of installed tool?

pipx has trouble installing/running coala-bears

Hi, pipx looks like a cool tool!

I'm trying to run a meta-linter named https://coala.io/ in pipx. Coala installs a lot of dependencies that often end up conflicting with other installed tools, so pipx seems perfect for running it. However, the recommended installation for Coala is pip3 install coala-bears, which installs the Python coala package (which includes the binary you actually run) as a dependency. Because of the indirect nature of making the binary available, pipx seems to be unable to find it.

$ pipx install coala-bears
No binaries associated with this package.

Running pipx install coala directly does work, but results in not having any of the necessary dependencies to run the various linters.

After running pipx install coala-bears, I actually can successfully run pipx coala even though it claimed there were no binaries. However, I'm unable to pass in arguments:

$ pipx coala --show-bears
usage: 
    pipx [--spec SPEC] [--python PYTHON] BINARY [BINARY-ARGS]
    pipx {install,upgrade,upgrade-all,uninstall,uninstall-all,list} [--help]
pipx: error: unrecognized arguments: --show-bears

I realize there's a lot of information to absorb here :P Is there anything obvious I'm doing wrong?

(additional note: pipsi also has a hard time with coala-bears, so I think coala is a bit of an edge case as far as trying to run Python stuff in an isolated environment)

For reference:

Thanks!

Issue when name of package isn't the name of executable

When trying to use just a one shot of the awscli pipx fails since the command you get when you install awscli is aws not awscli. Maybe have an option where you can specify --opt-cmd to allow you to change the command being passed in?

root@efceac62900a:/# pipx awscli
awscli not found in package awscli. Available binaries: aws, aws.cmd, aws_bash_completer, aws_completer, aws_zsh_completer.sh

Support bootstrap installations with pip install --user

User story: I am an experienced GNU/Linux developer. I only install non-distro packages with installers I trust, so that I reduce the risk of running malicious code. For example, I use pip install --user and to install non-Debian Python packages from PyPI.

Problem: Thus, I don't want to run curl https://raw.githubusercontent.com... | python3 to install pipx.

Suggested solution 1:

A PyPI package called pipx-bootstrap that functions as follows:

pip install --user pipx-bootstrap
pipx-bootstrap # installs pipx-app from PyPI into correct location
pip uninstall pipx-bootstrap
pipx upgrade pipx-app # should work

Suggested solution 2:

Instructions on how to use pip to install pipx-app into the correct location, so that pipx upgrade pipx-app works thereafter.

Suggested solution 3:

Upstream packaging :D

apt install python-pipx # installs system version (you can stop here if you only trust distro for system tools)
pipx install pipx-app # install local user version
pipx upgrade pipx-app # upgrades local user version

get-pipx.py fails if ~/.local/pipx does not exist

$ curl https://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py -fsSL | python3 - --no-modify-path
Traceback (most recent call last):
  File "<stdin>", line 221, in <module>
  File "<stdin>", line 193, in main
  File "/home/neersighted/.pyenv/versions/3.7.0/lib/python3.7/pathlib.py", line 1230, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/neersighted/.local/pipx/venvs'

Only show message about packages that need update when updating

Hi! Currently when I run pipx upgrade-all I get the following output:

jupyter-core is already at latest version 4.4.0 (location: /home/pedro/.local/pipx/venvs/jupyter-core)
ipython is already at latest version 7.1.1 (location: /home/pedro/.local/pipx/venvs/ipython)
ranger-fm is already at latest version 1.9.2 (location: /home/pedro/.local/pipx/venvs/ranger-fm)
pgcli is already at latest version 2.0.1 (location: /home/pedro/.local/pipx/venvs/pgcli)
raiseorlaunch is already at latest version 2.1.0 (location: /home/pedro/.local/pipx/venvs/raiseorlaunch)
vim-vint is already at latest version 0.3.19 (location: /home/pedro/.local/pipx/venvs/vim-vint)
pipx is already at latest version 0.9.3 (location: /home/pedro/.local/pipx/venvs/pipx)
beautysh is already at latest version 3.11 (location: /home/pedro/.local/pipx/venvs/beautysh)
black is already at latest version 18.9b0 (location: /home/pedro/.local/pipx/venvs/black)
mypy is already at latest version 0.641 (location: /home/pedro/.local/pipx/venvs/mypy)
flake8 is already at latest version 3.6.0 (location: /home/pedro/.local/pipx/venvs/flake8)
yamllint is already at latest version 1.13.0 (location: /home/pedro/.local/pipx/venvs/yamllint)
sqlparse is already at latest version 0.2.4 (location: /home/pedro/.local/pipx/venvs/sqlparse)
mycli is already at latest version 1.19.0 (location: /home/pedro/.local/pipx/venvs/mycli)
neovim-remote is already at latest version 2.1.1 (location: /home/pedro/.local/pipx/venvs/neovim-remote)
trash-cli is already at latest version 0.17.1.14 (location: /home/pedro/.local/pipx/venvs/trash-cli)

Instead of printing a line for every installed package can we only print lines for packages that were actually updated or if no packages needs and update then simply print something like All packages up to date, nothing to do? Thanks!

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.