• pip install --user broken in debian testing?

    From Barry Scott@21:1/5 to All on Sun Feb 26 11:10:01 2023
    I have been using the following to add useful python based commands to
    my user locally:

    $ python3 -m pip install --user <package>

    For install I get this:

    $ python3 -m pip install --user colour-text
    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.

    This look wrong to me as I am not installing into the systems site-packages.

    Barry

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?RGFuaWFsIEJlaHphZGkg2K/Yp@21:1/5 to All on Sun Feb 26 15:10:01 2023
    ------IARK2Q488N9VZRGBNY26WM3H2XY4TM
    Content-Type: text/plain;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    That's the new intended behavior. I you want non-debian python packages, install them in a non-debian python via virtual environments.

    در ۲۶ فوریهٔ ۲۰۲۳ ۱۰:۰۴:۲۰ (UTC)، Barry Scott <barry@barrys-emacs.org> نوشت:
    I have been using the following to add useful python based commands to my user locally:

    $ python3 -m pip install --user <package>

    For install I get this:

    $ python3 -m pip install --user colour-text
    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.

    This look wrong to me as I am not installing into the systems site-packages.

    Barry


    ------IARK2Q488N9VZRGBNY26WM3H2XY4TM
    Content-Type: text/html;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    <html><head></head><body><div dir="auto">That's the new intended behavior. I you want non-debian python packages, install them in a non-debian python via virtual environments.</div><br><br><div class="gmail_quote"><div dir="auto">در ۲۶ فوریهٔ ۲
    ۰۲۳ ۱۰:۰۴:۲۰ (UTC)، Barry Scott &lt;barry@barrys-emacs.org&gt; نوشت:</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
    <pre class="k9mail"><div dir="auto">I have been using the following to add useful python based commands to my user locally:<br><br>$ python3 -m pip install --user &lt;package&gt;<br><br>For install I get this:<br><br>$ python3 -m pip install --user
    colour-text<br>error: externally-managed-environment<br><br>× This environment is externally managed<br>╰─&gt; To install Python packages system-wide, try apt install<br>&nbsp;&nbsp;&nbsp; python3-xyz, where xyz is the package you are trying to<br>&
    nbsp;&nbsp;&nbsp; install.<br><br>&nbsp;&nbsp;&nbsp; If you wish to install a non-Debian-packaged Python package,<br>&nbsp;&nbsp;&nbsp; create a virtual environment using python3 -m venv path/to/venv.<br>&nbsp;&nbsp;&nbsp; Then use path/to/venv/bin/
    python and path/to/venv/bin/pip. Make<br>&nbsp;&nbsp;&nbsp; sure you have python3-full installed.<br><br>&nbsp;&nbsp;&nbsp; If you wish to install a non-Debian packaged Python application,<br>&nbsp;&nbsp;&nbsp; it may be easiest to use pipx install xyz,
    which will manage a<br>&nbsp;&nbsp;&nbsp; virtual environment for you. Make sure you have pipx installed.<br><br>&nbsp;&nbsp;&nbsp; See /usr/share/doc/python3.11/README.venv for more information.<br><br>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.<br>hint: See PEP 668 for the detailed specification.<br><br>This look wrong
    to me as I am not installing into the systems site-packages.<br><br>Barry<br><br></div></pre></blockquote></div></body></html>
    ------IARK2Q488N9VZRGBNY26WM3H2XY4TM--

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barry Scott@21:1/5 to All on Sun Feb 26 21:40:01 2023
    On 26 Feb 2023, at 14:06, ⁨Danial Behzadi دانیال بهزادی⁩ <⁨dani.behzi@ubuntu.com⁩> wrote:

    That's the new intended behavior. I you want non-debian python packages, install them in a non-debian python via virtual environments.

    The idea is to prevent installing into /usr not preventing install in $USER I hope.

    I think this is a major bug.

    Barry







    در ۲۶ فوریهٔ ۲۰۲۳ ۱۰:۰۴:۲۰ (UTC)، Barry Scott <barry@barrys-emacs.org> نوشت:
    I have been using the following to add useful python based commands to my user locally:

    $ python3 -m pip install --user <package>

    For install I get this:

    $ python3 -m pip install --user colour-text
    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.

    This look wrong to me as I am not installing into the systems site-packages. >>
    Barry



    <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><div><br><blockquote type="cite"><div>On 26 Feb 2023, at 14:06, ⁨
    Danial Behzadi دانیال بهزادی⁩ &lt;⁨dani.behzi@ubuntu.com⁩&gt; wrote:</div><br class="Apple-interchange-newline"><div><div><div dir="auto">That's the new intended behavior. I you want non-debian python packages, install them in a non-
    debian python via virtual environments.</div></div></div></blockquote><div><br></div><div>The idea is to prevent installing into /usr not preventing install in $USER I hope.</div><div><br></div><div>I think this is a major bug.</div><div><br></div><div>
    Barry</div><div><br></div><div><br></div><div><br></div><blockquote type="cite"><div><div><br></div><div><br></div></div></blockquote><br><blockquote type="cite"><div><div><br><div class="gmail_quote"><div dir="auto">در ۲۶ فوریهٔ ۲۰۲۳ ۱۰:
    ۴:۲۰ (UTC)، Barry Scott &lt;barry@barrys-emacs.org&gt; نوشت:</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
    <pre class="k9mail"><div dir="auto">I have been using the following to add useful python based commands to my user locally:<br><br>$ python3 -m pip install --user &lt;package&gt;<br><br>For install I get this:<br><br>$ python3 -m pip install --user
    colour-text<br>error: externally-managed-environment<br><br>× This environment is externally managed<br>╰─&gt; To install Python packages system-wide, try apt install<br>&nbsp;&nbsp;&nbsp; python3-xyz, where xyz is the package you are trying to<br>&
    nbsp;&nbsp;&nbsp; install.<br><br>&nbsp;&nbsp;&nbsp; If you wish to install a non-Debian-packaged Python package,<br>&nbsp;&nbsp;&nbsp; create a virtual environment using python3 -m venv path/to/venv.<br>&nbsp;&nbsp;&nbsp; Then use path/to/venv/bin/
    python and path/to/venv/bin/pip. Make<br>&nbsp;&nbsp;&nbsp; sure you have python3-full installed.<br><br>&nbsp;&nbsp;&nbsp; If you wish to install a non-Debian packaged Python application,<br>&nbsp;&nbsp;&nbsp; it may be easiest to use pipx install xyz,
    which will manage a<br>&nbsp;&nbsp;&nbsp; virtual environment for you. Make sure you have pipx installed.<br><br>&nbsp;&nbsp;&nbsp; See /usr/share/doc/python3.11/README.venv for more information.<br><br>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.<br>hint: See PEP 668 for the detailed specification.<br><br>This look wrong
    to me as I am not installing into the systems site-packages.<br><br>Barry<br><br></div></pre></blockquote></div></div></div></blockquote></div><br></body></html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrey Rakhmatullin@21:1/5 to Barry Scott on Sun Feb 26 22:20:01 2023
    On Sun, Feb 26, 2023 at 08:36:20PM +0000, Barry Scott wrote:
    That's the new intended behavior. I you want non-debian python packages, install them in a non-debian python via virtual environments.

    The idea is to prevent installing into /usr not preventing install in $USER I hope.
    You can read the idea in the document that was linked in the message you
    got.
    To quote it, "This applies both to system-wide installs (sudo pip install)
    as well as user home directory installs (pip install --user), since
    packages in either location show up on the sys.path of /usr/bin/python3."

    Please aso note that debian-mentors@ is not a support channel, that would
    be debian-user@.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Victor Westerhuis@21:1/5 to Barry Scott on Mon Feb 27 00:00:01 2023
    Barry Scott <barry@barrys-emacs.org> schreef op 26 februari 2023 21:36:20 CET:


    On 26 Feb 2023, at 14:06, ⁨Danial Behzadi دانیال بهزادی⁩ <⁨dani.behzi@ubuntu.com⁩> wrote:

    That's the new intended behavior. I you want non-debian python packages, install them in a non-debian python via virtual environments.

    The idea is to prevent installing into /usr not preventing install in $USER I hope.
    According to the PEP it's both, and it actually makes sense. Python does not distinguish between packages in system-wide and user-specific locations.

    Allowing non-virtualized installation of Python packages into the user-specific location could therefore break Python programs and libraries installed by apt/dpkg.

    Virtualized installations do not cause issues and are still allowed using, for example, pipx or raw venvs.

    I think this is a major bug.

    Barry







    در ۲۶ فوریهٔ ۲۰۲۳ ۱۰:۰۴:۲۰ (UTC)، Barry Scott <barry@barrys-emacs.org> نوشت:
    I have been using the following to add useful python based commands to my user locally:

    $ python3 -m pip install --user <package>

    For install I get this:

    $ python3 -m pip install --user colour-text
    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.

    This look wrong to me as I am not installing into the systems site-packages.

    Barry




    --
    Groet, Regards,

    Victor Westerhuis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barry Scott@21:1/5 to All on Thu Mar 2 11:50:02 2023
    On 27 Feb 2023, at 22:40, ⁨Danial Behzadi دانیال بهزادی⁩ <⁨dani.behzi@ubuntu.com⁩> wrote:

    As a developer who runs many Python apps with Systemd for years, I can say that using virtual environments was the only standard way even before this behavior change. It add no complexity and prevents a lot of things yo go wrong.

    For my day job we package the python code in RPMs and control versions that way for Centos servers.
    venv are one way, buyt not the only way.

    Barry



    This is the new standard for Python which Debian respects it too.


    در ۲۷ فوریهٔ ۲۰۲۳ ۱۴:۱۹:۱۸ (UTC)، Thomas Ward <teward@thomas-ward.net <mailto:teward@thomas-ward.net>> نوشت:
    If I may make an observation, how would one implement these venvs properly then if something requires to be launchdd via systemd (custom services)? Or specialized daemons which do not properly behave as expected in venvs?

    This is going to increase complexity massovely for end users who expect userspace module installation to work. Was this decision a Debian level decision or an upstream Python decision?



    Sent from my Galaxy



    -------- Original message --------
    From: Victor Westerhuis <victor@westerhu.is>
    Date: 2/26/23 17:56 (GMT-05:00)
    To: debian-mentors@lists.debian.org, Barry Scott <barry@barrys-emacs.org>, Danial Behzadi دانیال بهزادی <dani.behzi@ubuntu.com>
    Subject: Re: pip install --user broken in debian testing?

    Barry Scott <barry@barrys-emacs.org> schreef op 26 februari 2023 21:36:20 CET:


    On 26 Feb 2023, at 14:06, ⁨Danial Behzadi دانیال بهزادی⁩ <⁨dani.behzi@ubuntu.com⁩> wrote:

    That's the new intended behavior. I you want non-debian python packages, install them in a non-debian python via virtual environments.

    The idea is to prevent installing into /usr not preventing install in $USER I hope.
    According to the PEP it's both, and it actually makes sense. Python does not distinguish between packages in system-wide and user-specific locations.

    Allowing non-virtualized installation of Python packages into the user-specific location could therefore break Python programs and libraries installed by apt/dpkg.

    Virtualized installations do not cause issues and are still allowed using, for example, pipx or raw venvs.

    I think this is a major bug.

    Barry







    در ۲۶ فوریهٔ ۲۰۲۳ ۱۰:۰۴:۲۰ (UTC)، Barry Scott <barry@barrys-emacs.org> نوشت:
    I have been using the following to add useful python based commands to my user locally:

    $ python3 -m pip install --user <package>

    For install I get this:

    $ python3 -m pip install --user colour-text
    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.

    This look wrong to me as I am not installing into the systems site-packages.

    Barry




    <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><div><br><blockquote type="cite"><div>On 27 Feb 2023, at 22:40, ⁨
    Danial Behzadi دانیال بهزادی⁩ &lt;⁨dani.behzi@ubuntu.com⁩&gt; wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div dir="auto" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-
    style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">As a developer
    who runs many Python apps with Systemd for years, I can say that using virtual environments was the only standard way even before this behavior change. It add no complexity and prevents a lot of things yo go wrong.<br></div></div></blockquote><div><br></
    <div>For my day job we package the python code in RPMs and control versions that way for Centos servers.</div><div>venv are one way, buyt not the only way.</div><div><br></div><div>Barry</div><div><br></div><div><br></div><blockquote type="cite"><div>
    <div dir="auto" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space:
    normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br>This is the new standard for Python which Debian respects it too.</div><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style:
    normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color:
    rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-
    text-stroke-width: 0px; text-decoration: none;"><div class="gmail_quote" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start;
    text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div dir="auto">در ۲۷ فوریهٔ ۲۰۲۳ ۱۴:۱۹:۱۸ (UTC)، Thomas Ward &lt;<a href="mailto:teward@thomas-
    ward.net">teward@thomas-ward.net</a>&gt; نوشت:</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="auto"><div
    dir="auto">If I may make an observation, how would one implement these venvs properly then if something requires to be launchdd via systemd (custom services)? Or specialized daemons which do not properly behave as expected in venvs?</div><div dir="auto"><
    </div><div dir="auto">This is going to increase complexity massovely for end users who expect userspace module installation to work.&nbsp; Was this decision a Debian level decision or an upstream Python decision?</div><div dir="auto"><br></div><div
    dir="auto"><br></div><div dir="auto"><br></div><div id="x_composer_signature" dir="auto"><div dir="auto" style="font-size: 12px; color: rgb(87, 87, 87);">Sent from my Galaxy</div></div><div dir="auto"><br></div><div><br></div><div><br></div><div>--------
    Original message --------</div><div>From: Victor Westerhuis &lt;victor@westerhu.is&gt;<span class="Apple-converted-space">&nbsp;</span></div><div>Date: 2/26/23 17:56 (GMT-05:00)<span class="Apple-converted-space">&nbsp;</span></div><div>To: debian-
    mentors@lists.debian.org, Barry Scott &lt;barry@barrys-emacs.org&gt;, Danial Behzadi دانیال بهزادی &lt;dani.behzi@ubuntu.com&gt;</div><div>Subject: Re: pip install --user broken in debian testing?<span class="Apple-converted-space">&nbsp;</
    span></div><div><br></div></div><font size="2"><span style="font-size: 11pt;"><div class="PlainText">Barry Scott &lt;barry@barrys-emacs.org&gt; schreef op 26 februari 2023 21:36:20 CET:<br>&gt;<br>&gt;<br>&gt;&gt; On 26 Feb 2023, at 14:06, ⁨Danial
    Behzadi دانیال بهزادی⁩ &lt;⁨dani.behzi@ubuntu.com⁩&gt; wrote:<br>&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt; That's the new intended behavior. I you want non-debian python packages, install them in a non-debian
    python via virtual environments.<br>&gt;<br>&gt;The idea is to prevent installing into /usr not preventing install in $USER I hope.<br>According to the PEP it's both, and it actually makes sense. Python does not distinguish between packages in system-
    wide and user-specific locations.<br><br>Allowing non-virtualized installation of Python packages into the user-specific location could therefore break Python programs and libraries installed by apt/dpkg.<br><br>Virtualized installations do not cause
    issues and are still allowed using, for example, pipx or raw venvs.<br>&gt;<br>&gt;I think this is a major bug.<br>&gt;<br>&gt;Barry<br>&gt;<br>&gt;<br>&gt;<br>&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt;<span class="Apple-
    converted-space">&nbsp;</span><br>&gt;<br>&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt; در ۲۶ فوریهٔ ۲۰۲۳ ۱۰:۰۴:۲۰ (UTC)، Barry Scott &lt;barry@barrys-emacs.org&gt; نوشت:<br>&gt;&gt;&gt; I have been using
    the following to add useful python based commands to my user locally:<br>&gt;&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt;&gt; $ python3 -m pip install --user &lt;package&gt;<br>&gt;&gt;&gt;<span class="Apple-converted-space">&
    nbsp;</span><br>&gt;&gt;&gt; For install I get this:<br>&gt;&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt;&gt; $ python3 -m pip install --user colour-text<br>&gt;&gt;&gt; error: externally-managed-environment<br>&gt;&gt;&gt;<span
    class="Apple-converted-space">&nbsp;</span><br>&gt;&gt;&gt; × This environment is externally managed<br>&gt;&gt;&gt; ╰─&gt; To install Python packages system-wide, try apt install<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; python3-xyz, where xyz is the
    package you are trying to<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; install.<br>&gt;&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; If you wish to install a non-Debian-packaged Python package,<br>&gt;&gt;&
    gt;&nbsp;&nbsp;&nbsp;&nbsp; create a virtual environment using python3 -m venv path/to/venv.<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; sure you have
    python3-full installed.<br>&gt;&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; If you wish to install a non-Debian packaged Python application,<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; it may be easiest to
    use pipx install xyz, which will manage a<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; virtual environment for you. Make sure you have pipx installed.<br>&gt;&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; See
    /usr/share/doc/python3.11/README.venv for more information.<br>&gt;&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt;&gt; 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.<br>&gt;&gt;&gt; hint: See PEP 668 for the detailed specification.<br>&gt;&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt;&
    gt; This look wrong to me as I am not installing into the systems site-packages.<br>&gt;&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;&gt;&gt; Barry<br>&gt;&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><br>&gt;</div></span></
    font></blockquote></div></div></blockquote></div><br></body></html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barry Scott@21:1/5 to All on Thu Mar 2 11:40:02 2023
    On 26 Feb 2023, at 20:42, Victor Westerhuis <victor@westerhu.is> wrote:

    Barry Scott <barry@barrys-emacs.org <mailto:barry@barrys-emacs.org>> schreef op 26 februari 2023 21:36:20 CET:


    On 26 Feb 2023, at 14:06, ⁨Danial Behzadi دانیال بهزادی⁩ <⁨dani.behzi@ubuntu.com <mailto:dani.behzi@ubuntu.com>⁩> wrote:

    That's the new intended behavior. I you want non-debian python packages, install them in a non-debian python via virtual environments.

    The idea is to prevent installing into /usr not preventing install in $USER I hope.
    According to the PEP it's both, and it actually makes sense. Python does not distinguish between packages in system-wide and user-specific locations.



    Allowing non-virtualized installation of Python packages into the user-specific location could therefore break Python programs and libraries installed by apt/dpkg.

    On Fedora they use the -s option for all system apps that use python to prevent breakage from user installed packages.

    I have been living in that happy world where pip install --user was safe to use.


    Virtualized installations do not cause issues and are still allowed using, for example, pipx or raw venvs.

    I am aware of that, but don't reach for venv for simple stuff.
    Clearly I'm going to have to figure out how to do this for my use case now.

    Barry


    I think this is a major bug.

    Barry







    در ۲۶ فوریهٔ ۲۰۲۳ ۱۰:۰۴:۲۰ (UTC)، Barry Scott <barry@barrys-emacs.org> نوشت:
    I have been using the following to add useful python based commands to my user locally:

    $ python3 -m pip install --user <package>

    For install I get this:

    $ python3 -m pip install --user colour-text
    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.

    This look wrong to me as I am not installing into the systems site-packages.

    Barry




    --
    Groet, Regards,

    Victor Westerhuis


    <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><div><br><blockquote type="cite"><div>On 26 Feb 2023, at 20:42,
    Victor Westerhuis &lt;victor@westerhu.is&gt; wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal;
    font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Barry Scott &lt;<
    /span><a href="mailto:barry@barrys-emacs.org" style="font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform:
    none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">barry@barrys-emacs.org</a><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal;
    font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !
    important;">&gt; schreef op 26 februari 2023 21:36:20 CET:</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start;
    text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps:
    normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-
    decoration: none;"><br><br><blockquote type="cite">On 26 Feb 2023, at 14:06, ⁨Danial Behzadi دانیال بهزادی⁩ &lt;⁨<a href="mailto:dani.behzi@ubuntu.com">dani.behzi@ubuntu.com</a>⁩&gt; wrote:<br><br>That's the new intended behavior. I
    you want non-debian python packages, install them in a non-debian python via virtual environments.<br></blockquote><br>The idea is to prevent installing into /usr not preventing install in $USER I hope.<br></blockquote><span style="caret-color: rgb(0, 0,
    0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-
    stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">According to the PEP it's both, and it actually makes sense. Python does not distinguish between packages in system-wide and user-specific locations.<span class="Apple-
    converted-space">&nbsp;</span></span></div></blockquote></div><div><br></div><div><blockquote type="cite"><div><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight:
    400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular;
    font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration:
    none; float: none; display: inline !important;">Allowing non-virtualized installation of Python packages into the user-specific location could therefore break Python programs and libraries installed by apt/dpkg.<span class="Apple-converted-space">&nbsp;</
    span></span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space:
    normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"></div></blockquote><div><br></div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">On Fedora they use the -s option for all system apps that use python to
    prevent breakage from user installed packages.</div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">I have been living in that happy world where pip install --user was
    safe to use.</div><div><br></div><blockquote type="cite"><div><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start;
    text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-
    caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">
    Virtualized installations do not cause issues and are still allowed using, for example, pipx or raw venvs.<span class="Apple-converted-space">&nbsp;</span></span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-
    style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"></div></
    blockquote><div><br></div><div>I am aware of that, but don't reach for venv for simple stuff.</div><div>Clearly I'm going to have to figure out how to do this for my use case now.</div><div><br></div><div>Barry</div><br><blockquote type="cite"><div><
    blockquote type="cite" style="font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space:
    normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;"><br>I think this is a major bug.<br><br>Barry<br><br><br><br><blockquote type="cite"><br><br></blockquote><br><blockquote
    type="cite"><br>در ۲۶ فوریهٔ ۲۰۲۳ ۱۰:۰۴:۲۰ (UTC)، Barry Scott &lt;barry@barrys-emacs.org&gt; نوشت:<br><blockquote type="cite">I have been using the following to add useful python based commands to my user locally:<br><br>$
    python3 -m pip install --user &lt;package&gt;<br><br>For install I get this:<br><br>$ python3 -m pip install --user colour-text<br>error: externally-managed-environment<br><br>× This environment is externally managed<br>╰─&gt; To install Python
    packages system-wide, try apt install<br>&nbsp;&nbsp;&nbsp;python3-xyz, where xyz is the package you are trying to<br>&nbsp;&nbsp;&nbsp;install.<br><br>&nbsp;&nbsp;&nbsp;If you wish to install a non-Debian-packaged Python package,<br>&nbsp;&nbsp;&nbsp;
    create a virtual environment using python3 -m venv path/to/venv.<br>&nbsp;&nbsp;&nbsp;Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make<br>&nbsp;&nbsp;&nbsp;sure you have python3-full installed.<br><br>&nbsp;&nbsp;&nbsp;If you wish to
    install a non-Debian packaged Python application,<br>&nbsp;&nbsp;&nbsp;it may be easiest to use pipx install xyz, which will manage a<br>&nbsp;&nbsp;&nbsp;virtual environment for you. Make sure you have pipx installed.<br><br>&nbsp;&nbsp;&nbsp;See /usr/
    share/doc/python3.11/README.venv for more information.<br><br>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.<br>hint: See PEP 668 for the detailed specification.<br><br>This look wrong to me as I am not installing into the systems site-packages.<br><br>Barry<br><br></blockquote></blockquote><br></blockquote><br style="caret-
    color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -
    webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-
    indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps:
    normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">--<span
    class="Apple-converted-space">&nbsp;</span></span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent:
    0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal;
    font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Groet, Regards,</
    span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space:
    normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal;
    text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style:
    normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display:
    inline !important;">Victor Westerhuis</span></div></blockquote></div><br></body></html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)