Skip to content

Commit 63848fe

Browse files
authored
Merge pull request #218 from chennes/breakSystemPackages
Add --break-system-packages when using --target
2 parents 3cfd802 + 48a0e1f commit 63848fe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

addonmanager_utilities.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,13 @@ def create_pip_call(args: List[str]) -> List[str]:
584584

585585
if using_system_pip_installation_location():
586586
args = remove_options_and_arg(args, ["--target", "--path"])
587+
elif "--target" in args or "--path" in args:
588+
# If we are not running in some sort of container, and are instead trying to install to a
589+
# specific directory, pip will complain because it doesn't know that we're effectively
590+
# using this as a virtual env: it's not accessible to non-FreeCAD installations (at least,
591+
# not without some extra work on the user's part). So add the --break-system-packages flag
592+
# so pip will allow us to write to the --target directory
593+
args.append("--break-system-packages")
587594

588595
if snap_package:
589596
call_args = ["pip", "--disable-pip-version-check"]

0 commit comments

Comments
 (0)