$ 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 ?????!
Current status
- It was working last week
- It wasn't working 10 minutes ago
- It works now
- I understand why it works now
- I understand why it wasn't working 10 minutes ago
- But I don't understand why it was working last week
@mcc isn’t this because pipx isolates apps into virtualenvs? So you would have to be in the venv to run python3 -m pdm?
@dancingmonkeys i never had to do that before. i thought it set up entry points or something
@mcc should work if you just run pdm and you have pipx in your path
@mcc my guess you had pdm installed globally previously and were using that.
@dancingmonkeys no, pdm is pointing to a script in ~/.local which is definitely installed by pipx. global pdm would be very worrisome because that would imply an ubuntu-vended pdm, which is bad and old
@mcc that is probably true. Maybe you were in a virtualenv when you did the python3 -m ? But to my knowledge pipx never worked the way you described.
@mcc@mastodon.social you probably have ~/.local/bin (or wherever pipx is installing binaries) in your PATH while python3 is still whatever your system python is
@mcc anything pipx-installed would not be accessible as `python -m ...`
@whitequark Oh.
Then why… was it… before
@mcc you had pdm installed in some other way that was competing
@whitequark sincerely not sure how that could have happened since ubuntu bans the use of pip
@whitequark @glyph another thing confusing me is what this means and why i haven't seen it before. i assume that in moving from whatever broken pdm i had to whatever pdm i've got now, i did a big version jump??
also when i try to install i get a failure on numpy with no error message :(
@whitequark @glyph update, pdm fix and changing my pyproject.toml to require a more recent version of python have resolved my issues??? i'm just gonna chalk this up to user error and move on, thank you for the help
@whitequark @mcc okay I think I have a forensic reconstruction of a possible scenario:
If you made a --system-site-packages virtualenv and THEN did a pip install --user, it would silently stick things into ~/.local/lib/python3.$X in a way that would be importable by the system python and that would never warn you in any way.
This might be a bug in something
@glyph @whitequark it's probably impossible to figure out what I did D: I didn't actually understand how to use pipx when I first set up this machine
@mcc @whitequark no need to stress about figuring it out precisely, this is a legit bug either way :)
@glyph @whitequark well what i fear is there might have been a point when i was trying to figure out how pipx worked that i just tried every thing i could think of and one of them might have resulted in something Weird
what's mostly weird to me is the LAST time python updated and blew away my pipxes, i just said "pipx install --force pdm" and THAT fixed it. so that's weird in a way "i fucked my system and it worked in a configuration it shouldn't have" isn't. the fucked->unfucked->fucked cycle
@mcc @whitequark as I am attempting to validate my discovery the upgrade is going great and also incredibly thematically appropriately for this particular conversation
@mcc @whitequark update: the VM no longer even boots. Just starts up to BIOS, I think it corrupted something so badly that the boot … sector? EFI configuration? … is no longer even recognizable
@glyph @whitequark Yup this sounds like python package management to me
@mcc @whitequark going to start calling Apple’s System Integrity Protection subsystem the Safely Install Python subsystem
@mcc @whitequark okay just for posterity I do want to point out that this is a joke, and that the thing that destroyed my ubuntu install was an Ubuntu installer bug, nothing to do with Python
@glyph @mcc @whitequark they did a glyph edition just for you! Quite the dedication to user experience!
@glyph @mcc @whitequark That's fair, but I have seen people render their systems unbootable just by accidentally trying to install a different version of Python as /usr/bin/python on Ubuntu.
@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.
@mcc did you `pip install --user pdm` at some point?
@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`
@mcc oh wait there's a python3-pdm in apt. did you install it that way?
@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.
@mcc that would track with a huge version jump, ubuntu is not famous for tracking upstream releases reliably
@mcc And the worst part is there's things you could do to investigate why it was working last week, if you'd known it was weird to do so... But not much to do after the fact...
Maybe `locate pdm/__main__.py` to see if there's any remnants of it in weird places?
@mcc I'm in this photo and I don't like it. D:
@mcc you... can't remove python from an ubuntu install, can you
if you could use pipenv instead then things would be so much better but something tells me that ubuntu would get very mad at you for trying
@mcc sorry I meant pyenv but typed pipenv because the python community is evil