Score:0

Apt and Python Errors

gh flag

Ubuntu 22.04.01 LTS Jammy

Something is very wrong with Apt, or python. I have no idea how to troubleshoot this. I've tried re-installing several versions of python, and re-installing software-properties-common. I've seen questions and answers related to other problems, but none of them apply or are many years old--trying such solutions would be dangerous.

$ sudo add-apt-repository ppa:deadsnakes/ppa
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 15, in <module>
    from softwareproperties.shortcuthandler import ShortcutException
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 26, in <module>
    from softwareproperties.extendedsourceslist import (SourceEntry,
  File "/usr/lib/python3/dist-packages/softwareproperties/extendedsourceslist.py", line 436
    def __init__(self, sourceslist=None, /, files=None):
                                         ^
SyntaxError: invalid syntax
guiverc avatar
cn flag
Have you changed the default python3 version? You mention "*several versions of python*" where the default should not be changed if you want to reply on package front-end tools like that command, as they'll misbehave. I'd suggest restoring the default `python3` back to default.
Gamma Logic avatar
gh flag
@guiverc This was the problem. Thanks! I had some weird symlink issues with /etc/alternatives involving python3. Replacing the bad symlink fixed a number of python related issues. You really saved me here, but as your reply isn't an answer, I'm unsure of how to mark it as accepted. (Newish to stackexchange)
guiverc avatar
cn flag
Nah sorry; but you understand Stack Exchange well; ie. accepting an answer; but I left only a comment. I've tagged the question as '*not-reproducible, problem went away thus unlikely to help future readers*' as I'm sure there will be multiple answers here already on fixing changes to default python (*it's a common mistake*). I'm glad you got it solved; but if you'd like some SE *rep*, write up your own answer (*and you can accept it in time*) & you can reference my *comment* or *hint* if it was helpful & you like.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.