Deutsch   English   Français   Italiano  
<pipx-20250112105347@ram.dialup.fu-berlin.de>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!feeds.phibee-telecom.net!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Using pipx for packages as opposed to applications
Date: 12 Jan 2025 09:54:35 GMT
Organization: Stefan Ram
Lines: 66
Expires: 1 Jan 2026 11:59:58 GMT
Message-ID: <pipx-20250112105347@ram.dialup.fu-berlin.de>
References: <ot5b5l-50ps.ln1@q957.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de Mgr8E2b/XXBngIhFATHz0AQgplFtUfrejKtT4KVhT1Hr82
Cancel-Lock: sha1:nOQFuPaefOpvjlFl1Pt61hITeqs= sha256:n0L3mw9/5i7I2Jo8aJQp0pFw6iRQyjBrkFadwTJce/E=
X-Copyright: (C) Copyright 2025 Stefan Ram. All rights reserved.
	Distribution through any means other than regular usenet
	channels is forbidden. It is forbidden to publish this
	article in the Web, to change URIs of this article into links,
        and to transfer the body without this notice, but quotations
        of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
	services to mirror the article in the web. But the article may
	be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Bytes: 3352

Chris Green <cl@isbd.net> wrote or quoted:
>Can one use pipx to wrap the process of creating an independent
>environment for a python package as opposed to a runnable application?

  .---------------------------------------------------------------.
  | Heads up, I haven't put this advice through its paces myself, |
  | so take it with a grain of salt!                              |
  '---------------------------------------------------------------'

  Yo, pipx is really more for setting up and running Python CLI
  apps in their own little bubbles, not so much for creating
  separate playgrounds for regular Python packages. But hey,
  you can still use pipx to kind of sorta get what you want with
  pksheet, even if it's not your typical command-line deal.

  Here's the lowdown on using pipx for pksheet:

  1. Drop pksheet in with pipx:

  bash

pipx install pksheet

  This bad boy will whip up a special spot just for pksheet and
  plop it in there.

  2. To rock pksheet in your Python scripts, you can run it through
  pipx like this:

  bash

pipx run pksheet your_script.py

  This move will fire up your script using the pksheet setup in
  its own little world.

  Now, while this trick works, it's not exactly smooth sailing for
  everyday package use. For non-CLI packages like pksheet, you're
  better off sticking to the old-school virtual environment tools:

  1. Whip up a virtual environment:

  bash

python3 -m venv pksheet_env

  2. Jump into that environment:

  bash

source pksheet_env/bin/activate

  3. Grab pksheet:

  bash

pip install pksheet

  4. Now you're golden to use pksheet in your Python scripts within
  this environment.

  To wrap it up, pipx can technically handle pksheet, but it's really
  more at home with CLI apps. For your run-of-the-mill Python packages,
  cooking up a dedicated virtual environment is the way to go.