dave1010 / clipea

📎🟢 Like Clippy but for the CLI. A blazing fast AI helper for your command line
MIT License
302 stars 11 forks source link

Replace pip with pipx for CLI installation #21

Closed lucaspar closed 10 months ago

lucaspar commented 10 months ago

Python as a community is demoting global contexts, historically the default, to favor local ones and encourage use of virtual environments for most cases. A global pip install will fail by default for Python >=3.11 in Debian-based distros, as well as other externally managed environments:

$ pip install clipea-cli
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

A popular distro-agnostic way to install user-wide binaries (as opposed to a package which is part of a project) is by using pipx instead. When part of a development installation, pip install is probably still a good choice.

dave1010 commented 10 months ago

Thanks for the PR and explanation!

(Note to self: clipea.zsh needs to be improved to handle different installs of clipea)

dave1010 commented 10 months ago

@all-contributors please add @lucaspar for doc

allcontributors[bot] commented 10 months ago

@dave1010

I've put up a pull request to add @lucaspar! :tada: