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
error: externally-managed-environment

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

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.
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
error: externally-managed-environment

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

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.
opendev$ python3.11 -m pip uninstall vedis --break-system-packages
WARNING: Skipping vedis as it is not installed.
opendev$ 
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
  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
  Running setup.py install for vedis ... [?25l- \ | / - done
[?25hSuccessfully installed vedis-0.7.2

[notice] A new release of pip is 
available: 23.0.1 -> 24.0
[notice] To update, run: 
pip install --upgrade pip
opendev$ 
opendev$ python3.10 -m pip install --user vedis
error: externally-managed-environment

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

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.
opendev$ 
opendev$ python3.10 -m pip install --user vedis --break-system-packages
Collecting vedis
  Downloading vedis-0.7.2.tar.gz (351 kB)
[?25l     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/351.1 
kB ? eta -:--:--
     ━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
10.2/351.1 kB ? eta -:--:--
     ━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
41.0/351.1 kB 329.2 kB/s eta 0:00:01
     ━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
61.4/351.1 kB 408.5 kB/s eta 0:00:01
     ━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
81.9/351.1 kB 457.0 kB/s eta 0:00:01
     ━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━ 
112.6/351.1 kB 430.6 kB/s eta 0:00:01
     ━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━ 
122.9/351.1 kB 420.3 kB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━ 
153.6/351.1 kB 427.1 kB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━ 
174.1/351.1 kB 445.4 kB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━ 
204.8/351.1 kB 433.5 kB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━ 
225.3/351.1 kB 447.8 kB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━ 
245.8/351.1 kB 428.7 kB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━ 
266.2/351.1 kB 429.3 kB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━ 
286.7/351.1 kB 439.5 kB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━ 
307.2/351.1 kB 446.0 kB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━ 
337.9/351.1 kB 438.4 kB/s eta 0:00:01
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 351.1/351.1 kB 
434.7 kB/s eta 0:00:00
[?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
error: externally-managed-environment

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

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.
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

Reply via email to