Index | Thread | Search

From:
Roger Marsh <r.m@rmswch.plus.com>
Subject:
'python3.10 -m pip install --user <package>' needs '--break-system-packages' argument
To:
ports@openbsd.org
Date:
Tue, 21 May 2024 10:05:47 +0000

Download raw body.

Thread
Hi,

Surely the --user argument should remove the need for the --break-system-packages argument?

I first ran into this yesterday while doing a 'python3 -m pip install --user --no-index --find-links <path> <package>' after upgrading Pythons 3.9.18p0, 3.10.13p0, and 3.11.8, to Pythons 3.9.19, 3.10.14, and 3.11.9, as part of 'pkg_add -u' before installing a new OpenBSD package.  (I am reasonably sure, but not certain, several of these were done while the pre-upgrade Pythons were installed.)

Below is what I see for the Python package vedis.


Script started on Tue May 21 09:12:12 2024
opendev$ ␇ls ~/.local/lib/python*/*vedis*
ls: /home/roger/.local/lib/python*/*vedis*: No such file or directory
opendev$ 
opendev$ ls ~/.local/lib/python*/*vedis* ␈␈␈␈␈␈␈␈␈//*vedis*␈␈␈␈␈␈␈␈s/*vedis*␈␈␈␈␈␈␈␈i/*vedis*␈␈␈␈␈␈␈␈t/*vedis*␈␈␈␈␈␈␈␈e/*vedis*␈␈␈␈␈␈␈␈-/*vedis*␈␈␈␈␈␈␈␈p/*vedis*␈␈␈␈␈␈␈␈a/*vedis*␈␈␈␈␈␈␈␈c/*vedis*␈␈␈␈␈␈␈␈k/*vedis*␈␈␈␈␈␈␈␈a/*vedis*␈␈␈␈␈␈␈␈g/*vedis*␈␈␈␈␈␈␈␈e/*vedis*␈␈␈␈␈␈␈␈s/*vedis*␈␈␈␈␈␈␈␈
/home/roger/.local/lib/python3.10/site-packages/vedis.cpython-310.so
/home/roger/.local/lib/python3.9/site-packages/vedis.cpython-39.so

/home/roger/.local/lib/python3.10/site-packages/vedis-0.7.2.dist-info:
INSTALLER       RECORD          WHEEL
METADATA        REQUESTED       top_level.txt

/home/roger/.local/lib/python3.9/site-packages/vedis-0.7.2-py3.9.egg-info:
PKG-INFO                   dependency_links.txt       requires.txt
SOURCES.txt                installed-files.txt        top_level.txt
opendev$ 
opendev$ python3.9 -m pip uninstall vedis
Found existing installation: vedis 0.7.2
Uninstalling vedis-0.7.2:
  Would remove:
    /home/roger/.local/lib/python3.9/site-packages/vedis-0.7.2-py3.9.egg-info
    /home/roger/.local/lib/python3.9/site-packages/vedis.cpython-39.so
Proceed (Y/n)? 
  Successfully uninstalled vedis-0.7.2
opendev$ 
opendev$ python3.10 -m pip uninstall vedis
␛[1;31merror␛[0m: ␛[1mexternally-managed-environment␛[0m

␛[31m×␛[0m This environment is externally managed
␛[31m╰─>␛[0m This Python installation is managed by pkg_add(1).
␛[31m   ␛[0m 
␛[31m   ␛[0m To install Python packages system-wide, use the OS packages where
␛[31m   ␛[0m possible, for example: "pkg_add py3-somepackage".
␛[31m   ␛[0m 
␛[31m   ␛[0m Otherwise, for software which is not available in packages,
␛[31m   ␛[0m it is recommended to create a "venv" (virtual environment, see
␛[31m   ␛[0m https://docs.python.org/3/library/venv.html) and install it there.
␛[31m   ␛[0m For standalone applications, pipx (in the py3-pipx package) can
␛[31m   ␛[0m help manage this for you.

␛[1;35mnote␛[0m: 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.
␛[1;36mhint␛[0m: See PEP 668 for the detailed specification.
opendev$ 
opendev$ python3.10 -m pip uninstall vedis --break-site-packages

Usage:   
  /usr/local/bin/python3.10 -m pip uninstall [options] <package> ...
  /usr/local/bin/python3.10 -m pip uninstall [options] -r <requirements file> ...

no such option: --break-site-packages
opendev$ python3.10 -m pip uninstall vedis --break-system-packages
Found existing installation: vedis 0.7.2
Uninstalling vedis-0.7.2:
  Would remove:
    /home/roger/.local/lib/python3.10/site-packages/vedis-0.7.2.dist-info/*
    /home/roger/.local/lib/python3.10/site-packages/vedis.cpython-310.so
Proceed (Y/n)? 
  Successfully uninstalled vedis-0.7.2
opendev$ 
opendev$ python 3.11 -m pip uninstall vedis --break-system-packages␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␈ ␈␇␇␇␇
opendev$ python 3.11 -m pip uninstall vedis
/bin/ksh: python: not found
opendev$ python3.11 -m pip uninstall vedis
␛[1;31merror␛[0m: ␛[1mexternally-managed-environment␛[0m

␛[31m×␛[0m This environment is externally managed
␛[31m╰─>␛[0m This Python installation is managed by pkg_add(1).
␛[31m   ␛[0m 
␛[31m   ␛[0m To install Python packages system-wide, use the OS packages where
␛[31m   ␛[0m possible, for example: "pkg_add py3-somepackage".
␛[31m   ␛[0m 
␛[31m   ␛[0m Otherwise, for software which is not available in packages,
␛[31m   ␛[0m it is recommended to create a "venv" (virtual environment, see
␛[31m   ␛[0m https://docs.python.org/3/library/venv.html) and install it there.
␛[31m   ␛[0m For standalone applications, pipx (in the py3-pipx package) can
␛[31m   ␛[0m help manage this for you.

␛[1;35mnote␛[0m: 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.
␛[1;36mhint␛[0m: See PEP 668 for the detailed specification.
opendev$ python3.11 -m pip uninstall vedis --break-system-packages
␛[33mWARNING: Skipping vedis as it is not installed.␛[0m␛[33m
␛[0mopendev$ 
opendev$ ls ~/.local/lib/python*/site-packages/*vedis*
ls: /home/roger/.local/lib/python*/site-packages/*vedis*: No such file or directory
opendev$ 
opendev$ 
opendev$ python3.9 -m pip install --user vedis
Collecting vedis
  Using cached vedis-0.7.2.tar.gz (351 kB)
  Preparing metadata (setup.py) ... ␛[?25l-␈ ␈\␈ ␈done
␛[?25hRequirement already satisfied: cython in ./.local/lib/python3.9/site-packages (from vedis) (3.0.10)
Installing collected packages: vedis
␛[33m  DEPRECATION: vedis is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559␛[0m␛[33m
␛[0m  Running setup.py install for vedis ... ␛[?25l-␈ ␈\␈ ␈|␈ ␈/␈ ␈-␈ ␈done
␛[?25hSuccessfully installed vedis-0.7.2

␛[1m[␛[0m␛[34;49mnotice␛[0m␛[1;39;49m]␛[0m␛[39;49m A new release of pip is available: ␛[0m␛[31;49m23.0.1␛[0m␛[39;49m -> ␛[0m␛[32;49m24.0␛[0m
␛[1m[␛[0m␛[34;49mnotice␛[0m␛[1;39;49m]␛[0m␛[39;49m To update, run: ␛[0m␛[32;49mpip install --upgrade pip␛[0m
opendev$ 
opendev$ python3.10 -m pip install --user vedis
␛[1;31merror␛[0m: ␛[1mexternally-managed-environment␛[0m

␛[31m×␛[0m This environment is externally managed
␛[31m╰─>␛[0m This Python installation is managed by pkg_add(1).
␛[31m   ␛[0m 
␛[31m   ␛[0m To install Python packages system-wide, use the OS packages where
␛[31m   ␛[0m possible, for example: "pkg_add py3-somepackage".
␛[31m   ␛[0m 
␛[31m   ␛[0m Otherwise, for software which is not available in packages,
␛[31m   ␛[0m it is recommended to create a "venv" (virtual environment, see
␛[31m   ␛[0m https://docs.python.org/3/library/venv.html) and install it there.
␛[31m   ␛[0m For standalone applications, pipx (in the py3-pipx package) can
␛[31m   ␛[0m help manage this for you.

␛[1;35mnote␛[0m: 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.
␛[1;36mhint␛[0m: See PEP 668 for the detailed specification.
opendev$ 
opendev$ python3.10 -m pip install --user vedis --break-system-packages
Collecting vedis
  Downloading vedis-0.7.2.tar.gz (351 kB)
␛[?25l     ␛[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m ␛[32m0.0/351.1 kB␛[0m ␛[31m?␛[0m eta ␛[36m-:--:--␛[0m
␛[2K     ␛[91m━␛[0m␛[90m╺␛[0m␛[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m ␛[32m10.2/351.1 kB␛[0m ␛[31m?␛[0m eta ␛[36m-:--:--␛[0m
␛[2K     ␛[91m━━━━␛[0m␛[90m╺␛[0m␛[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m ␛[32m41.0/351.1 kB␛[0m ␛[31m329.2 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━␛[0m␛[91m╸␛[0m␛[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m ␛[32m61.4/351.1 kB␛[0m ␛[31m408.5 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━␛[0m␛[91m╸␛[0m␛[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m ␛[32m81.9/351.1 kB␛[0m ␛[31m457.0 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━␛[0m␛[91m╸␛[0m␛[90m━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m ␛[32m112.6/351.1 kB␛[0m ␛[31m430.6 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━━␛[0m␛[91m╸␛[0m␛[90m━━━━━━━━━━━━━━━━━━━━━━━━␛[0m ␛[32m122.9/351.1 kB␛[0m ␛[31m420.3 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━━━━━━␛[0m␛[90m╺␛[0m␛[90m━━━━━━━━━━━━━━━━━━━━␛[0m ␛[32m153.6/351.1 kB␛[0m ␛[31m427.1 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━━━━━━━━␛[0m␛[90m╺␛[0m␛[90m━━━━━━━━━━━━━━━━━━␛[0m ␛[32m174.1/351.1 kB␛[0m ␛[31m445.4 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━━━━━━━━━━━␛[0m␛[91m╸␛[0m␛[90m━━━━━━━━━━━━━━━␛[0m ␛[32m204.8/351.1 kB␛[0m ␛[31m433.5 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━━━━━━━━━━━━━␛[0m␛[91m╸␛[0m␛[90m━━━━━━━━━━━━━␛[0m ␛[32m225.3/351.1 kB␛[0m ␛[31m447.8 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m␛[91m╸␛[0m␛[90m━━━━━━━━━━━␛[0m ␛[32m245.8/351.1 kB␛[0m ␛[31m428.7 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m␛[90m╺␛[0m␛[90m━━━━━━━━␛[0m ␛[32m266.2/351.1 kB␛[0m ␛[31m429.3 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m␛[90m╺␛[0m␛[90m━━━━━━␛[0m ␛[32m286.7/351.1 kB␛[0m ␛[31m439.5 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m␛[90m╺␛[0m␛[90m━━━━␛[0m ␛[32m307.2/351.1 kB␛[0m ␛[31m446.0 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[91m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m␛[91m╸␛[0m␛[90m━␛[0m ␛[32m337.9/351.1 kB␛[0m ␛[31m438.4 kB/s␛[0m eta ␛[36m0:00:01␛[0m
␛[2K     ␛[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━␛[0m ␛[32m351.1/351.1 kB␛[0m ␛[31m434.7 kB/s␛[0m eta ␛[36m0:00:00␛[0m
␛[?25h  Preparing metadata (setup.py) ... ␛[?25l-␈ ␈\␈ ␈|␈ ␈/␈ ␈done
␛[?25hRequirement already satisfied: cython in /usr/local/lib/python3.10/site-packages (from vedis) (0.29.36)
Building wheels for collected packages: vedis
  Building wheel for vedis (setup.py) ... ␛[?25l-␈ ␈\␈ ␈|␈ ␈/␈ ␈-␈ ␈\␈ ␈|␈ ␈done
␛[?25h  Created wheel for vedis: filename=vedis-0.7.2-cp310-cp310-openbsd_7_5_amd64.whl size=705044 sha256=201d7f6d228b13738c7f25ad95898b8a734466e6d04eaca68a1bef6d317daa46
  Stored in directory: /home/roger/.cache/pip/wheels/b0/1d/cf/c89f8de6035b0c2606061850a5bf967ed0665f9beb3fa4abdc
Successfully built vedis
Installing collected packages: vedis
Successfully installed vedis-0.7.2
opendev$ 
opendev$ python3.11 -m pip install --user vedis
␛[1;31merror␛[0m: ␛[1mexternally-managed-environment␛[0m

␛[31m×␛[0m This environment is externally managed
␛[31m╰─>␛[0m This Python installation is managed by pkg_add(1).
␛[31m   ␛[0m 
␛[31m   ␛[0m To install Python packages system-wide, use the OS packages where
␛[31m   ␛[0m possible, for example: "pkg_add py3-somepackage".
␛[31m   ␛[0m 
␛[31m   ␛[0m Otherwise, for software which is not available in packages,
␛[31m   ␛[0m it is recommended to create a "venv" (virtual environment, see
␛[31m   ␛[0m https://docs.python.org/3/library/venv.html) and install it there.
␛[31m   ␛[0m For standalone applications, pipx (in the py3-pipx package) can
␛[31m   ␛[0m help manage this for you.

␛[1;35mnote␛[0m: 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.
␛[1;36mhint␛[0m: See PEP 668 for the detailed specification.
opendev$ 
opendev$ python3.11 -m pip install --user vedis --break-system-packages
Collecting vedis
  Using cached vedis-0.7.2.tar.gz (351 kB)
  Installing build dependencies ... ␛[?25l-␈ ␈\␈ ␈|␈ ␈/␈ ␈-␈ ␈\␈ ␈done
␛[?25h  Getting requirements to build wheel ... ␛[?25l-␈ ␈done
␛[?25h  Installing backend dependencies ... ␛[?25l-␈ ␈\␈ ␈|␈ ␈/␈ ␈-␈ ␈\␈ ␈done
␛[?25h  Preparing metadata (pyproject.toml) ... ␛[?25l-␈ ␈\␈ ␈done
␛[?25hCollecting cython (from vedis)
  Using cached Cython-3.0.10-py2.py3-none-any.whl.metadata (3.2 kB)
Using cached Cython-3.0.10-py2.py3-none-any.whl (1.2 MB)
Building wheels for collected packages: vedis
  Building wheel for vedis (pyproject.toml) ... ␛[?25l-␈ ␈\␈ ␈|␈ ␈/␈ ␈-␈ ␈done
␛[?25h  Created wheel for vedis: filename=vedis-0.7.2-cp311-cp311-openbsd_7_5_amd64.whl size=810099 sha256=cc2f107af3e53fc09975ee8d90d3d4d1006ba58c74d115db78a40e07bcab402a
  Stored in directory: /home/roger/.cache/pip/wheels/4f/1d/20/0182cf465539e998f8e9e0ee0b5b15e002f2aba1fb486cc6dc
Successfully built vedis
Installing collected packages: cython, vedis
Successfully installed cython-3.0.10 vedis-0.7.2
opendev$ 
opendev$ ls ~/.local/lib/python*/site-packages/*vedis*
/home/roger/.local/lib/python3.10/site-packages/vedis.cpython-310.so
/home/roger/.local/lib/python3.11/site-packages/vedis.cpython-311.so
/home/roger/.local/lib/python3.9/site-packages/vedis.cpython-39.so

/home/roger/.local/lib/python3.10/site-packages/vedis-0.7.2.dist-info:
INSTALLER       RECORD          WHEEL
METADATA        REQUESTED       top_level.txt

/home/roger/.local/lib/python3.11/site-packages/vedis-0.7.2.dist-info:
INSTALLER       RECORD          WHEEL
METADATA        REQUESTED       top_level.txt

/home/roger/.local/lib/python3.9/site-packages/vedis-0.7.2-py3.9.egg-info:
PKG-INFO                   dependency_links.txt       requires.txt
SOURCES.txt                installed-files.txt        top_level.txt
opendev$ 
opendev$ ls ~/.local/lib/python*/site-packages/*[Cc]ython*
/home/roger/.local/lib/python3.11/site-packages/cython.py
/home/roger/.local/lib/python3.9/site-packages/cython.py

/home/roger/.local/lib/python3.11/site-packages/Cython:
Build           Debugger        Plex            StringIOTree.py Utility
CodeWriter.py   Debugging.py    Runtime         Tempita         Utils.py
Compiler        Distutils       Shadow.py       TestUtils.py    __init__.py
Coverage.py     Includes        Shadow.pyi      Tests           __pycache__

/home/roger/.local/lib/python3.11/site-packages/Cython-3.0.10.dist-info:
COPYING.txt         LICENSE.txt         RECORD              entry_points.txt
INSTALLER           METADATA            WHEEL               top_level.txt

/home/roger/.local/lib/python3.9/site-packages/Cython:
Build           Debugger        Plex            StringIOTree.py Utility
CodeWriter.py   Debugging.py    Runtime         Tempita         Utils.py
Compiler        Distutils       Shadow.py       TestUtils.py    __init__.py
Coverage.py     Includes        Shadow.pyi      Tests           __pycache__

/home/roger/.local/lib/python3.9/site-packages/Cython-3.0.10.dist-info:
COPYING.txt         LICENSE.txt         RECORD              entry_points.txt
INSTALLER           METADATA            WHEEL               top_level.txt
opendev$ 
opendev$ exit

Script done on Tue May 21 09:34:37 2024


Thanks,

Roger