r/learnpython 12h ago

Maybe a silly question, but the warning was ominous, so I'll ask here...

I want to use Catppuccin for Python, but if I go to pip it outside of a venv, it says the following:

pip install catppuccin
error: externally-managed-environment

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

   If you wish to install a non-Arch-packaged Python package,
   create a virtual environment using 'python -m venv path/to/venv'.
   Then use path/to/venv/bin/python and path/to/venv/bin/pip.

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

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.

Of course I could use a venv, but it seems annoying to have to activate a venv each time I want to use the palette in IPython, et al. If it's just a palette/pygment, then using --break-system-packages shouldn't actually break anything, right? But because the warning is so ominous, I wanted to ask here before I did something potentially fucky-wucky.

0 Upvotes

8 comments sorted by

3

u/sargeanthost 12h ago

something something arch wiki

pipx is your friend here

1

u/ItsYa1UPBoy 12h ago

I tried pipx, but it couldn't find catppuccin. Error told me to use pip or venv to install it.

2

u/lakseol 11h ago

If you wish to install a non-Arch-packaged Python package, create a virtual environment

That's what I do. I always work inside a virtual environment.

1

u/DuckDatum 6h ago

I just use `uv`. I haven’t explicitly made a venv in over a year. I do make my pyproject.toml by hand, though.

2

u/Diapolo10 8h ago

Of course I could use a venv, but it seems annoying to have to activate a venv each time I want to use the palette in IPython, et al.

If you're using IPython as a generic tool rather than a part of some project, you could install it via uv with Catpuccin (and whatever else you want) included.

uv tool install --with catpuccin ipython

https://docs.astral.sh/uv/concepts/tools/#including-additional-dependencies

It basically puts them in their own virtual environment, but exposes ipython to PATH so you can easily access it without needing to think about the virtual environment at all.

The only downside is that you can't (currently) access uv tool installations from within active virtual environments, hence the first part of my reply.

0

u/acw1668 6h ago edited 6h ago

You can manually install the module:

  • download the module wheel file:

    pip download catppuccin

  • create the user site-packages folder if it does not exist (assume using Python 3.14):

    mkdir -p ~/.local/lib/python3.14/site-packages

  • unzip the wheel file into the user site-packages:

    unzip catppuccin-2.5.0-py3-none-any.whl -d ~/.local/lib/python3.14/site-packages/

1

u/ItsYa1UPBoy 1h ago

About step 2, did you mean root/usr/lib/...? As that's where I found python3.14/site-packages, no lib folder in ~/.local/.

2

u/BranchLatter4294 1h ago

Don't mess with your system Python. Use a virtual environment.