Re: Terminal Emulator (Posting On Python-List Prohibited)
On 20/05/2024 10:58, Peter J. Holzer wrote: On 2024-05-20 00:26:03 +0200, Roel Schroeven via Python-list wrote: Skip Montanaro via Python-list schreef op 20/05/2024 om 0:08: Modern debian (ubuntu) and fedora block users installing using pip. Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I assumed pip install --user would work, but no. I tried it (on Debian 12 (bookworm)): $ pip install --user docopt error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installed. See /usr/share/doc/python3.11/README.venv for more information. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. Exactly the same output for sudo pip install. This message (quoted in all its glory) is too long to be useful. The important bit is at the end: You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. (I admit I didn't see this the first time I got this message) python3 -m pip install --user --break-system-packages does indeed install into ~/.local/lib/python3.XX/site-packages. This inconvenient, but otoh I have accidentally installed packages into ~/.local in the past, so maybe it's good to make that more explicit. hp Perhaps an alias like so: $ alias 'pip install'='pip install --user --break-system-packages' Would work here? Someone please advise if that is a good idea. -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
I'm on Manjaro Of course, I'm not here to tell you how to use your computer, and it's great that you're using Linux, but I'd suggest that you look into installing Arch Linux proper. Arch Linux isn't as difficult as people make it out to be (I'd argue that anyone who's had to deal with the Calamares installer has seen worse), and it's hugely rewarding as it gives you a fundamental overview of how your system operates and what makes it tick, since you need to install it yourself manually. Plus, Manjaro holds back packages by about a month or so, sometimes more, which breaks AUR packages, which are designed around Arch Linux's packages, which are newer. On top of this, the Manjaro team just can't be trusted with basic things like not having their SSL certs expire on their website (this has happened half a dozen times in the past, which is embarassing, given that things like certbot make installing a certificate the easiest thing in the world). Again, I'm not some power hungry elitist Arch Linux shill or whatever, it's your computer, use it how you want, these are just my suggestions. Don't say I didn't warn you though :) -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 2024-05-20 00:26:03 +0200, Roel Schroeven via Python-list wrote: > Skip Montanaro via Python-list schreef op 20/05/2024 om 0:08: > > > Modern debian (ubuntu) and fedora block users installing using pip. > > > > Even if you're telling it to install in ~/.local? I could see not allowing > > to run it as root. > > I assumed pip install --user would work, but no. I tried it (on Debian 12 > (bookworm)): > > > $ pip install --user docopt > > error: externally-managed-environment > > > > × This environment is externally managed > > ╰─> To install Python packages system-wide, try apt install > > python3-xyz, where xyz is the package you are trying to > > install. > > > > If you wish to install a non-Debian-packaged Python package, > > create a virtual environment using python3 -m venv path/to/venv. > > Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make > > sure you have python3-full installed. > > > > If you wish to install a non-Debian packaged Python application, > > it may be easiest to use pipx install xyz, which will manage a > > virtual environment for you. Make sure you have pipx installed. > > > > See /usr/share/doc/python3.11/README.venv for more information. > > > > note: If you believe this is a mistake, please contact your Python > > installation or OS distribution provider. You can override this, at the > > risk of breaking your Python installation or OS, by passing > > --break-system-packages. > > hint: See PEP 668 for the detailed specification. > > Exactly the same output for sudo pip install. This message (quoted in all its glory) is too long to be useful. The important bit is at the end: > > You can override this, at the risk of breaking your Python > > installation or OS, by passing --break-system-packages. (I admit I didn't see this the first time I got this message) python3 -m pip install --user --break-system-packages does indeed install into ~/.local/lib/python3.XX/site-packages. This inconvenient, but otoh I have accidentally installed packages into ~/.local in the past, so maybe it's good to make that more explicit. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 5/19/2024 6:00 PM, Karsten Hilbert via Python-list wrote: Am Sun, May 19, 2024 at 10:45:09PM +0100 schrieb Barry via Python-list: On 18 May 2024, at 16:27, Peter J. Holzer via Python-list wrote: I don't think Linux users have to deal with venvs Modern debian (ubuntu) and fedora block users installing using pip. You must use a venv to pip install packages from pypi now. Which makes one wonder how one is supposed to package Python applications requiring modules not yet packaged by Debian. I confess, I sometimes install those packages using pip's self-warning option "--break-system-packages". Naturally I only install them with --user. Another option besides venvs is to install a different version of Python from python.org, not by using the system installer. For example, if your system version is, say, 3.8.10 (as it is on my Mint VM), install 3.11.9 and make sure you always launch pip with python3.11 -m pip I have done this on some VMs, and use the system's Python on some others. Happily none of my Linux VMs are critical for anything. I can blow them away and recreate them without worry. -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 5/19/2024 6:34 PM, Grant Edwards via Python-list wrote: On 2024-05-19, Barry via Python-list wrote: On 18 May 2024, at 16:27, Peter J. Holzer via Python-list wrote: I don't think Linux users have to deal with venvs Modern debian (ubuntu) and fedora block users installing using pip. You can't even use pip to do "user" installs? Nope, often not. The error messages I've gotten do tell you to use the "--break-system-packages" flag if you really, really want to install the package. So python3 -m pip install --user --break-system-packages [--upgrade] Or install an additional version of Python that isn't managed by the system. Grant -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 5/19/2024 6:08 PM, Skip Montanaro via Python-list wrote: Modern debian (ubuntu) and fedora block users installing using pip. Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I honestly haven't tried. Maybe I should... 樂 I have an old laptop running XUbuntu 22.04 which I generally only use to compile the most recent branches on GitHub (main, 3.12, & 3.13 at the moment). On some (maybe all) of my Linux VMs, pip - the one installed for the system - won't install something even with --user unless you use the --break-system-packages flag. -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 2024-05-19, Barry via Python-list wrote: > > >> On 18 May 2024, at 16:27, Peter J. Holzer via Python-list >> wrote: >> >> I don't think Linux users have to deal with venvs > > Modern debian (ubuntu) and fedora block users installing using pip. You can't even use pip to do "user" installs? -- Grant -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 2024-05-19, Gilmeh Serda via Python-list wrote: > On Sun, 19 May 2024 08:32:46 +0100, Alan Gauld wrote: > >> I've honestly never experienced this "nightmare". >> I install stuff and it just works. > > Hear! Hear! Me too! And all that. > > I'm on Manjaro, which is a tad finicky about other people touching its > Python since it's used for lots of things. I install things for myself > only. > > Was there a reason they chose the name Pip? I always assumed it was in honor of the PIP (Peripheral Interchange Program?) utility that was used to copy files around on CP/M and DEC's PDP-11 OSes. -- Grant -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
Skip Montanaro via Python-list schreef op 20/05/2024 om 0:08: Modern debian (ubuntu) and fedora block users installing using pip. > Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I assumed pip install --user would work, but no. I tried it (on Debian 12 (bookworm)): $ pip install --user docopt error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installed. See /usr/share/doc/python3.11/README.venv for more information. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. Exactly the same output for sudo pip install. For easy reference here's a link to that PEP 668: https://peps.python.org/pep-0668/ Which links to the "Externally Managed Environments" on the PyPA specs page: https://packaging.python.org/en/latest/specifications/externally-managed-environments/#externally-managed-environments -- "If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed." -― Onbekend (dikwijls toegeschreven aan Mark Twain, waarschijnlijk onterecht) -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
Modern debian (ubuntu) and fedora block users installing using pip. > Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I honestly haven't tried. Maybe I should... 樂 I have an old laptop running XUbuntu 22.04 which I generally only use to compile the most recent branches on GitHub (main, 3.12, & 3.13 at the moment). Skip -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
Am Sun, May 19, 2024 at 10:45:09PM +0100 schrieb Barry via Python-list: > > On 18 May 2024, at 16:27, Peter J. Holzer via Python-list > > wrote: > > > > I don't think Linux users have to deal with venvs > > Modern debian (ubuntu) and fedora block users installing using pip. > You must use a venv to pip install packages from pypi now. Which makes one wonder how one is supposed to package Python applications requiring modules not yet packaged by Debian. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
> On 18 May 2024, at 16:27, Peter J. Holzer via Python-list > wrote: > > I don't think Linux users have to deal with venvs Modern debian (ubuntu) and fedora block users installing using pip. You must use a venv to pip install packages from pypi now. This is implemented in python and pip and enabled by the distros. There are ways to turn off the blocking, but it’s strongly discouraged by the distros. Barry -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 2024-05-19 at 18:13:23 +, Gilmeh Serda via Python-list wrote: > Was there a reason they chose the name Pip? Package Installer for Python https://pip.pypa.io/en/stable/index.html -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 2024-05-19 19:13, Gilmeh Serda via Python-list wrote: On Sun, 19 May 2024 08:32:46 +0100, Alan Gauld wrote: I've honestly never experienced this "nightmare". I install stuff and it just works. Hear! Hear! Me too! And all that. I'm on Manjaro, which is a tad finicky about other people touching its Python since it's used for lots of things. I install things for myself only. Was there a reason they chose the name Pip? [snip] From https://pip.pypa.io/en/stable/: "pip is the package installer for Python." It's an acronym. -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 2024-05-19 at 18:13:23 +, Gilmeh Serda via Python-list wrote: > Was there a reason they chose the name Pip? Package Installer for Python https://pip.pypa.io/en/stable/index.html Every time I see PIP, I think Peripheral Interchange Program, but I'm old. -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 5/19/2024 3:32 AM, Alan Gauld via Python-list wrote: On 18/05/2024 19:12, Piergiorgio Sartor via Python-list wrote: [snip] The dependency nightmare created by python, pip and all the rest cannot be resolved otherwise. I've honestly never experienced this "nightmare". I install stuff and it just works. One way it can bite even you is if you have a program installed whose requirements claim it needs a certain library of version no higher than X, and you already already have a later version of that library installed since one of your other programs requires it. Pip won't install the new program because of this conflict. In reality, you may know the the new program would work fine with the version of the library you installed, but the packagers of the new program didn't realize they should have updated their requirements. With venvs, you can have separate environments for each. Of course this doesn't help if you need both packages in the same environment... -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 2024-05-19, Alan Gauld via Python-list wrote: >> The dependency nightmare created by python, pip >> and all the rest cannot be resolved otherwise. > > I've honestly never experienced this "nightmare". > I install stuff and it just works. Same here. I occasonlly use pip to install something that isn't packaged for Gentoo, but it doesn't seem to cause problems — let alone nightmares. I also occasionally package something myself. -- Grant -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 18/05/2024 19:12, Piergiorgio Sartor via Python-list wrote: >> So venvs make managing all that pretty convenient. Dunno why everybody's >> so down on venvs... Not so much down on them, they are just one extra step that's mostly not needed(in my use case) > Only people which are *not* using python... :-) > > In my experience, venvs is the only possible > way to use python properly. Well, I've been using Python since 1998 on Linux, Windows and MacOS and have yet to find a use for a venv. I've played with them when they first came out but haven't actually found a scenario where I've thought "I need a venv for that!" But then I'm a sole user, I have 3 or 4 projects going but only me working on them. I only have 2 Python versions at any time and the OS handles that just fine without any venvs. > The dependency nightmare created by python, pip > and all the rest cannot be resolved otherwise. I've honestly never experienced this "nightmare". I install stuff and it just works. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list
venvs vs. package management (was: Terminal Emulator (Posting On Python-List Prohibited))
On 2024-05-18 20:12:33 +0200, Piergiorgio Sartor via Python-list wrote: > On 18/05/2024 20.04, Mats Wichmann wrote: > > So venvs make managing all that pretty convenient. Dunno why everybody's > > so down on venvs... > > Only people which are *not* using python... :-) > > In my experience, venvs is the only possible > way to use python properly. That's very much depends on what you mean by properly. Personally, I use venvs a lot. But most of the reasons have more to do with team culture than technical constraints. In a different situation (e.g. if all our developers used Linux and preferrably the same version) I could see myself using venvs much less or maybe not at all. > The dependency nightmare created by python, pip and all the rest > cannot be resolved otherwise. That's what package management on Linux is for. Sure, it means that you won't have the newest version of anything and some packages not at all, but you don't have to care about dependencies. Or updates. (Missing packages can be a problem: Is there a script to automatically generate .deb packages from PyPI? I haven't looked recently ...) > It seems backward compatibility is a taboo... I have recently written a script which checks out the newest version of the project, creates a fresh venv using a requirements.txt without version numbers and runs the test suite. If there is any action required (either because a test fails or because there is a newer version of any dependent package) it will create a ticket in redmine. Oh, and this script runs on a staging server which has the same Linux distribution (and hence the same Python version) as the production server. Seems to work, but that is only necessary because we are using venvs. If we relied on the distro's package management that would basically be a non-issue. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 18/05/2024 20.04, Mats Wichmann wrote: [...] So venvs make managing all that pretty convenient. Dunno why everybody's so down on venvs... Only people which are *not* using python... :-) In my experience, venvs is the only possible way to use python properly. The dependency nightmare created by python, pip and all the rest cannot be resolved otherwise. It seems backward compatibility is a taboo... bye, -- piergiorgio -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 2024-05-18, Mats Wichmann via Python-list wrote: > Distros have do offer a good selection of packaged Python bits, yes, but > only for the version of Python that's "native" to that distro release. > If you need to test other versions of Python, you're mostly on your own. For a few years I needed both 2.x and 3.x installed, but my distro (Gentoo) handled that fine (I think most others do also). Gentoo also allows multiple minor versions to be installed (currently I have 3.11 and 3.12 on this machine). But, since Gentoo is a source-based meta-distro, when I install a Python package, the package manager knows how to install it for all installed Python versions that are supported by the package. I can't think of why I would need a venv unless I needed to test something with a Python version that isn't available for Gentoo. That said, there are currently 7 versions available (2.7.18, 3.8.19, 3.9.19, 3.10.14, 3.11.9, 3.12.3, 3.13.0). 3.13 isn't marked stable yet in the Gentoo package database, and I apparently have some Python app/package installed that doesn't yet support 3.12, so I've currently got both 3.12 and 3.11. -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 5/18/24 10:48, Grant Edwards via Python-list wrote: On 2024-05-18, Peter J. Holzer via Python-list wrote: On 2024-05-16 19:46:07 +0100, Gordinator via Python-list wrote: To be fair, the problem is the fact that they use Windows (but I guess Linux users have to deal with venvs, so we're even. I don't think Linux users have to deal with venvs any more than Windows users. Maybe even less because many distributions come with a decent set of Python packages. I've been using Python on Linux almost daily for 25 years, same here, but: and I've yet to use a venv... Distros have do offer a good selection of packaged Python bits, yes, but only for the version of Python that's "native" to that distro release. If you need to test other versions of Python, you're mostly on your own. Just as an example, for a particular project I had one test machine running Fedora 38 until just a couple weeks ago, with Python 3.11 as "native" with a full suite of packages, but I needed to test 3.12 and then the 3.13 pre-releases, as well as occasionally sanity-check the "oldest supported Python for this project", which turned out to be 3.6. I could build all those Pythons myself and install them to a location I can "python3.xx -m pip install" to, but Fedora is nice enough to package up a whole bunch of past and future Python versions, so why? And Fedora really discourages doing installs via pip to a system-packaged Python. So venvs make managing all that pretty convenient. Dunno why everybody's so down on venvs... -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 2024-05-18, Peter J. Holzer via Python-list wrote: > On 2024-05-16 19:46:07 +0100, Gordinator via Python-list wrote: > >> To be fair, the problem is the fact that they use Windows (but I >> guess Linux users have to deal with venvs, so we're even. > > I don't think Linux users have to deal with venvs any more than > Windows users. Maybe even less because many distributions come with > a decent set of Python packages. I've been using Python on Linux almost daily for 25 years, and I've yet to use a venv... -- Grant -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 2024-05-16 19:46:07 +0100, Gordinator via Python-list wrote: > To be fair, the problem is the fact that they use Windows (but I guess Linux > users have to deal with venvs, so we're even. I don't think Linux users have to deal with venvs any more than Windows users. Maybe even less because many distributions come with a decent set of Python packages. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature -- https://mail.python.org/mailman/listinfo/python-list
Re: Terminal Emulator (Posting On Python-List Prohibited)
On 16/05/2024 01:12, Lawrence D'Oliveiro wrote: On 15 May 2024 10:31:25 GMT, Stefan Ram wrote: We need somethin like a portable curses module (plus colorama) and it has got to work on both Windoze and Linux straight out of the box in standard Python. Something else for Windows Python users to complain that they cannot get to install properly? To be fair, the problem is the fact that they use Windows (but I guess Linux users have to deal with venvs, so we're even. -- https://mail.python.org/mailman/listinfo/python-list