mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

348K
active users

$ python3 -m pdm install
/usr/bin/python3: No module named pdm
$ pipx install pdm
'pdm' already seems to be installed. Not modifying existing installation in
'/home/mcc/.local/pipx/venvs/pdm'. Pass '--force' to force installation.

For heck's sake this is just going to happen every time Ubuntu upgrades python forever, isn't it.

I thought the entire point of pipx was to prevent this.

The quickfixes I used last time to fix this problem are not fixing it :(

pipx force-reinstall did not work. pipx install --force pdm did not work. rm -r ~/.local/pipx/ && pipx install pdm did not work. any of the above followed by opening a new bash shell did not work. starting to get worried. maybe ubuntu has simply decided i should not be using pipx to install apps anymore.

Wait.

I can't access my pipx-installed pdm by running `python3 -m pdm`, but I can access it by just running `pdm`.

?? ??? ?why ??? would that ??? change ?????!

@mcc python3 -m pdm implies that whichever 'python3' that is can import 'pdm'. But pipx installed pdm has its own virtualenv and thus its own 'python3', which you never see.

@glyph okay. so this makes sense. but now i'm baffled why python -m pdm has been working for me since last year without problems

@mcc did you `pip install --user pdm` at some point?

@glyph If ubuntu would have allowed that, then conceivably?

@mcc let me let my ubuntu install out of the oubliette for a moment to check

@mcc huh. looks like no, unless you did a `--break-system-packages`

Glyph

@mcc oh wait there's a python3-pdm in apt. did you install it that way?

@glyph i installed that one then uninstalled it because it was *really* old.

@mcc @glyph that sounds like a really good culprit for causing the weirdness

@SnoopJ @glyph So like, I uninstalled it but something inappropriately stayed around? And then two updates later an apt script finally cleaned it up properly? Geez, maybe.

@mcc @glyph oh hrm I misread Glyph's remark, thought it was `python3-pipx`, and I could *sorta* see Ubuntu doing something weird if they had an official pipx package.

+1 to sentiment that `python3 -m pdm` working in the first place is probably the core mystery, although it's hard to imagine `apt` would drop the ball *that* hard.

Sounds like you managed to get back to a consistent state, at least.

@SnoopJ @mcc have you installed other versions of Python outside of Apt?

@glyph @SnoopJ I mean I want to say "no" but i'm doubting many pillars of reality at this point

@mcc @glyph @SnoopJ I once "came to" and was at my computer with 8 versions of nodejs installed and had no memory of installing even one.

@mcc @SnoopJ I am trying to construct a scenario that could break the system site packages protection unintentionally, but of course any edge case which works properly right now *might* have had a defect on whatever past version of Ubuntu you used

@mcc that would track with a huge version jump, ubuntu is not famous for tracking upstream releases reliably