
Ubuntu server 22.04 LTS I must have done something really wrong when an app I was trying to install a few days ago insisted on running on Python 2. I installed some stuff (don´t recall what) that made it work, but it appears to have broken the other Python three apps that I have been using on the server. Both `python` and `python3` seem to offer appropriate interactive responses, but when I try to run `deluged` it responds with: Traceback (most recent call last): File "/usr/bin/deluged", line 33, in <module> sys.exit(load_entry_point('deluge==2.1.1', 'gui_scripts', 'deluged')()) File "/usr/bin/deluged", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load module = import_module(match.group('module')) File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/usr/lib/python3/dist-packages/deluge/core/daemon_entry.py", line 15, in <module> from deluge.argparserbase import ArgParserBase File "/usr/lib/python3/dist-packages/deluge/argparserbase.py", line 16, in <module> import deluge.log File "/usr/lib/python3/dist-packages/deluge/log.py", line 19, in <module> from twisted.internet import defer File "/usr/local/lib/python3.10/dist-packages/twisted/internet/defer.py", line 40, in <module> import attr ModuleNotFoundError: No module named 'attr' Another app, nzbdplus, reports that it's running properly (after `apt reinstall`) but my usual pointing a browser to the web port 8080 doesn't work (connection reset). When I run it on the console it appears to work -- despite complaining about certificates -- but won´t open for a browser on a local network Any suggestions? Maybe the answer is obvious and I'm just overtired. Many thanks for any help. Evan Leibovitch, Toronto Canada @evanleibovitch / @el56

On 06/11/2022 21.14, Evan Leibovitch via talk wrote:
I must have done something really wrong when an app I was trying to install a few days ago insisted on running on Python 2.
Did you accidentally install "python-is-python2"? It will break modern things in a hilarious manner. There's python-is-python3 to undo the damage. Stewart

Thanks, but didn't help. Evan Leibovitch, Toronto Canada @evanleibovitch / @el56 On Mon, Nov 7, 2022 at 12:00 AM Stewart C. Russell via talk <talk@gtalug.org> wrote:
On 06/11/2022 21.14, Evan Leibovitch via talk wrote:
I must have done something really wrong when an app I was trying to install a few days ago insisted on running on Python 2.
Did you accidentally install "python-is-python2"? It will break modern things in a hilarious manner.
There's python-is-python3 to undo the damage.
Stewart --- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

| From: Stewart C. Russell via talk <talk@gtalug.org> | Did you accidentally install "python-is-python2"? It will break modern things | in a hilarious manner. | | There's python-is-python3 to undo the damage. Wow. The Python2 -> Python3 transition is still claiming victims! I am not sold on containers, but it sure is an argument for ONLY allowing Python2 in containers. Kind of like radioactive waste. Or maybe it is time to write off all Python2-only code. After all, official maintenance is over, even security maintenance. After 10 years, if I remember correctly. Contrast this with the C -> C++ transition. They can coexist. In fact, I personally program in C, not C++, and don't find problems caused by C++ being on my system. ============================ There's another thing that bothers me about Python (and a few other projects). I get almost all my software from my distro (Fedora Linux). But there are reasons to get things through Python's "pip". Surely these two sources clash. There is a similar problem with several rich ecosystems. For example Rust, Perl, TeX/LaTeX, ... In the background are the many issues of trust (eg. "supply chain attacks").

On Mon, Nov 7, 2022 at 10:41 AM D. Hugh Redelmeier via talk <talk@gtalug.org> wrote:
Wow. The Python2 -> Python3 transition is still claiming victims!
You bet! I think it will continue for some time. I *think* that systems are only supposed to provide an executable called "python3" now, but de facto, the executable "python" seems to be a free-for-all. I only found one current system of mine where /usr/bin/python was Python 2.7: somehow I'd got python-is-python2 installed there.
Contrast this with the C -> C++ transition. They can coexist.
C++ never said it was going to replace C entirely, though. And the commands to invoke the compilers have always been different.
I get almost all my software from my distro (Fedora Linux). But there are reasons to get things through Python's "pip". Surely these two sources clash.
Yes: you can leave things in a mess doing that. So far I've never broken things entirely. So far. I occasionally have to check that my system Python hasn't been hijacked by a large package install. Anaconda did that to me once, putting its own path ahead of my one without telling me. Conversely, many of the embedded build systems I use hide their own Python3 distributions deep in their own path so they can guarantee that it'll work. Some of these are so huge (Espressif ESP IDF 4.4 comes in at around 20 GB with all dependencies to build on Tensilica and RISC-V cores) that an entire Python distro is a tiny part of the whole. The size of TeX Live makes me sad, because I remember it being "unimaginably complete" when my late and vastly effusive friend Sebastian Rahtz announced the project as filling a whole CD-ROM in the late 1990s. It's now many times that size, and will automatically be installed on your system if you go near any Gnu documentation. Stewart

On Mon, Nov 07, 2022 at 02:53:55PM -0500, Stewart Russell via talk wrote:
You bet! I think it will continue for some time.
I *think* that systems are only supposed to provide an executable called "python3" now, but de facto, the executable "python" seems to be a free-for-all. I only found one current system of mine where /usr/bin/python was Python 2.7: somehow I'd got python-is-python2 installed there.
If python 2.7 is installed, it is correct for it to be named /usr/bin/python. If python 2 is not installed, /usr/bin/python should not exist at all. Python 3 should always be /usr/bin/python3 and hence no conflict can ever exist between them.
C++ never said it was going to replace C entirely, though. And the commands to invoke the compilers have always been different.
Yes C++ never claimed to be C.
Yes: you can leave things in a mess doing that. So far I've never broken things entirely. So far.
I occasionally have to check that my system Python hasn't been hijacked by a large package install. Anaconda did that to me once, putting its own path ahead of my one without telling me. Conversely, many of the embedded build systems I use hide their own Python3 distributions deep in their own path so they can guarantee that it'll work. Some of these are so huge (Espressif ESP IDF 4.4 comes in at around 20 GB with all dependencies to build on Tensilica and RISC-V cores) that an entire Python distro is a tiny part of the whole.
The size of TeX Live makes me sad, because I remember it being "unimaginably complete" when my late and vastly effusive friend Sebastian Rahtz announced the project as filling a whole CD-ROM in the late 1990s. It's now many times that size, and will automatically be installed on your system if you go near any Gnu documentation.
I only use one packaging system on my machines. pip and anaconda are evil abomonations and should never be used. :) I despise how many new languages think it's their job to invent a new distribution platform for modules for that language. -- Len Sorensen

On Mon, Nov 7, 2022 at 10:42 AM D. Hugh Redelmeier via talk <talk@gtalug.org> wrote:
I get almost all my software from my distro (Fedora Linux). But there are reasons to get things through Python's "pip". Surely these two sources clash.
I'm almost certain that this is at least a partial source of my problem. I also notice how I now have a whole ~/.local subdirectory containing Pythonish executables and library files. That did not exist before nor did ~/.cache

On Sun, Nov 06, 2022 at 11:59:21PM -0500, Stewart C. Russell via talk wrote:
Did you accidentally install "python-is-python2"? It will break modern things in a hilarious manner.
There's python-is-python3 to undo the damage.
Well anything that follows the guidelines from python upstream would know that python is never python3. python is python2 and python3 is python3. Don't write python 3 code and put !#/usr/bin/python in it. -- Len Sorensen

On 07/11/2022 20.14, Lennart Sorensen wrote:
Well anything that follows the guidelines from python upstream would know that python is never python3.
That's the problem: no other language has tried to do the rule-from-above thing. And they are guidelines, right, so they're optional?
python is python2 and python3 is python3. Don't write python 3 code and put !#/usr/bin/python in it.
I think you might have a lifetime to spend explaining that at just about every kids' code camp. Stewart

On Tue, Nov 08, 2022 at 02:24:03PM -0500, Stewart C. Russell via talk wrote:
That's the problem: no other language has tried to do the rule-from-above thing. And they are guidelines, right, so they're optional?
I think you might have a lifetime to spend explaining that at just about every kids' code camp.
Well as far as I can tell every major linux distribution has got it right, and the issue mainly seems to happen on windows where apparently people can't get anything right. -- Len Sorensen

| From: Lennart Sorensen via talk <talk@gtalug.org> | Well as far as I can tell every major linux distribution has got it right, | and the issue mainly seems to happen on windows where apparently people | can't get anything right. If I had to guess, Evan's problem (the one that started this thread) stems from a software package that hasn't been updated in some time and no longer matches what the distro provides. Packages bit-rot. One can do things to reduce this effect but it can hardly be eliminated. Sometimes a package is smart enough to refuse to install when its requrements are not met. But users aren't happy. How many screw-heads have been mangled my impatient users with to wrong screwdriver? Speaking of bit-rot, ... I recently bought a scanner from CZUR because it was to support Linux. Well, they only supplied a binary .deb package. This is a problem: - .deb won't work on my Fedora system - "alien" won't turn it into a .rpm - after a few queries, CZUR support sent me an RPM - the RPM elicits error from dnf on my system - CZUR support says to use "dnf --force". I haven't tried yet. This solution is going to suffer bit-rot. It was a mistake thinking that this scanner supports Linux in a meaningful way.

On Wed, Nov 09, 2022 at 12:04:44PM -0500, D. Hugh Redelmeier via talk wrote:
If I had to guess, Evan's problem (the one that started this thread) stems from a software package that hasn't been updated in some time and no longer matches what the distro provides.
Packages bit-rot. One can do things to reduce this effect but it can hardly be eliminated.
Sometimes a package is smart enough to refuse to install when its requrements are not met. But users aren't happy. How many screw-heads have been mangled my impatient users with to wrong screwdriver?
Speaking of bit-rot, ...
I recently bought a scanner from CZUR because it was to support Linux. Well, they only supplied a binary .deb package. This is a problem: - .deb won't work on my Fedora system - "alien" won't turn it into a .rpm - after a few queries, CZUR support sent me an RPM - the RPM elicits error from dnf on my system - CZUR support says to use "dnf --force". I haven't tried yet.
This solution is going to suffer bit-rot. It was a mistake thinking that this scanner supports Linux in a meaningful way.
I see people claiming many CZUR scaners are just UVC devices, and that there exists programs that can capture from that, like guvcview and a few others. It strangely does sound like it is actually more of a video camera than a scanner. Maybe your model is something else? -- Len Sorensen

On 2022-11-09 16:00, Lennart Sorensen via talk wrote:
On Wed, Nov 09, 2022 at 12:04:44PM -0500, D. Hugh Redelmeier via talk wrote:
I recently bought a scanner from CZUR because it was to support Linux. Well, they only supplied a binary .deb package. [snip] This solution is going to suffer bit-rot. It was a mistake thinking that this scanner supports Linux in a meaningful way.
I see people claiming many CZUR scaners are just UVC devices, and that there exists programs that can capture from that, like guvcview and a few others.
If it helps I found a page from two years ago where some asked about using a CZUR scanner. That page said they had installed and ran the Windows software using Wine but the driver was still an issue. That page pointed to a web page from four years earlier that said it is a UVC device. That page has some information about using the scanner. If it helps, the page is at: http://www.johnwillis.com/2016/04/czur-scannerscanning-with-linux.html The scanner has no support in XSane? Is there any support for it in VueScan? -- Cheers! Kevin. http://www.ve3syb.ca/ | "Nerds make the shiny things that https://www.patreon.com/KevinCozens | distract the mouth-breathers, and | that's why we're powerful" Owner of Elecraft K2 #2172 | #include <disclaimer/favourite> | --Chris Hardwick

On Nov 6, 2022, at 21:14, Evan Leibovitch via talk <talk@gtalug.org> wrote:
Ubuntu server 22.04 LTS
But did you install all your packages and dependencies through normal Ubuntu packages? The paths in the “deluged” traceback suggest that not all of them were, but that’s going on my old understanding that Ubuntu installs its packages as the same place as Debian: /usr/lib/python3/dist-packages/twisted, in the case of Twisted. The paths to the not-Twisted sources in that traceback point to where I would expect to see distro-packaged python libraries and applications.
Both `python` and `python3` seem to offer appropriate interactive responses, but when I try to run `deluged` it responds with:
Traceback (most recent call last): [...] File "/usr/local/lib/python3.10/dist-packages/twisted/internet/defer.py", line 40, in <module> import attr ModuleNotFoundError: No module named 'attr'
The Python module “attr" is found in the Ubuntu package “python3-attr”. It is one of the dependencies of the python3-twisted package. What is its status? Does “import attr” succeed in an interactive python 3 session?
Another app, nzbdplus, reports that it's running properly (after `apt reinstall`) but my usual pointing a browser to the web port 8080 doesn't work (connection reset).
When I run it on the console it appears to work -- despite complaining about certificates -- but won´t open for a browser on a local network
Any suggestions? Maybe the answer is obvious and I'm just overtired.
My guess would be that its connected to CherryPy (python3-cherrypy3), if by “nzbdplus” you are referring to the contents of the sabnzbdplus package. To be more specific, I would expect the python3-openssl package that it recommends to be the one most likely to cause complaints about certificates, and python3-cheroot is the actual HTTP server that it uses. The package python3-cryptography should also be checked.

Hi Seneca, So... I reinstalled all of the Ubuntu Python module packages you mentioned, without much progress until I reinstalled python3-attr. Then the errors and messages reduced but I could see other things missing. Re-installing python3-babelfish and python-automat have reduced the error messages yet further and now when I start deluged, deluge-web and sabnzbdplus from 'service' the status on all three look normal (though I can't yet acces them on the local network). Not fully resolved but I might just be able to make it work without reinstalling. Many thanks! (Now what do I do with all this cruft in ~/.local and ~/.cache?) Evan Leibovitch, Toronto Canada @evanleibovitch / @el56 PS: Once upon a time I was really into TeX and even Metafont. I used to program databases to "print" LaTeX code so that even invoices would look typeset. But that was in a former life and I have things to do. On Mon, Nov 7, 2022 at 2:32 PM Seneca Cunningham <tentra@gmail.com> wrote:
On Nov 6, 2022, at 21:14, Evan Leibovitch via talk <talk@gtalug.org> wrote:
Ubuntu server 22.04 LTS
But did you install all your packages and dependencies through normal Ubuntu packages? The paths in the “deluged” traceback suggest that not all of them were, but that’s going on my old understanding that Ubuntu installs its packages as the same place as Debian: /usr/lib/python3/dist-packages/twisted, in the case of Twisted. The paths to the not-Twisted sources in that traceback point to where I would expect to see distro-packaged python libraries and applications.
Both `python` and `python3` seem to offer appropriate interactive responses, but when I try to run `deluged` it responds with:
Traceback (most recent call last):
[...]
File "/usr/local/lib/python3.10/dist-packages/twisted/internet/defer.py", line 40, in <module> import attr ModuleNotFoundError: No module named 'attr'
The Python module “attr" is found in the Ubuntu package “python3-attr”. It is one of the dependencies of the python3-twisted package. What is its status? Does “import attr” succeed in an interactive python 3 session?
Another app, nzbdplus, reports that it's running properly (after `apt reinstall`) but my usual pointing a browser to the web port 8080 doesn't work (connection reset).
When I run it on the console it appears to work -- despite complaining about certificates -- but won´t open for a browser on a local network
Any suggestions? Maybe the answer is obvious and I'm just overtired.
My guess would be that its connected to CherryPy (python3-cherrypy3), if by “nzbdplus” you are referring to the contents of the sabnzbdplus package. To be more specific, I would expect the python3-openssl package that it recommends to be the one most likely to cause complaints about certificates, and python3-cheroot is the actual HTTP server that it uses. The package python3-cryptography should also be checked.

On Nov 7, 2022, at 16:21, Evan Leibovitch <evan@telly.org> wrote: (Now what do I do with all this cruft in ~/.local and ~/.cache?)
Depends upon what it is. It could be python modules, Firefox cache files, bits and bobs from zsh accessories, nvim swap files, who knows. That’s the joy of the XDG Base Directory Specification. My Macs and FreeBSD boxen aren’t spared their presence, as all those examples I’ve mentioned are ones that I found on my own computers..
Evan Leibovitch, Toronto Canada @evanleibovitch / @el56
PS: Once upon a time I was really into TeX and even Metafont. I used to program databases to "print" LaTeX code so that even invoices would look typeset. But that was in a former life and I have things to do.
Once upon a time, I wrote a new templating environment for LedgerSMB. I convinced it to output invoices through XeTeX so that the invoices were not limited to ASCII.

The OS has python needs and your app has its own. It's usually best to keep those things independent to avoid dependency conflicts. Using something like virtualenv or pyenv to create a separate python environment and then using the pip in it to install dependencies works well.
participants (8)
-
D. Hugh Redelmeier
-
Evan Leibovitch
-
Kevin Cozens
-
Lennart Sorensen
-
Seneca Cunningham
-
Stewart C. Russell
-
Stewart Russell
-
Tim Tisdall