Addon Manager: use versioned Python package dirs
This commit is contained in:
@@ -339,11 +339,20 @@ def get_python_exe() -> str:
|
||||
if not python_exe or not os.path.exists(python_exe):
|
||||
return ""
|
||||
|
||||
python_exe = python_exe.replace("/",os.path.sep)
|
||||
python_exe = python_exe.replace("/", os.path.sep)
|
||||
prefs.SetString("PythonExecutableForPip", python_exe)
|
||||
return python_exe
|
||||
|
||||
|
||||
def get_pip_target_directory():
|
||||
# Get the default location to install new pip packages
|
||||
major, minor, _ = platform.python_version_tuple()
|
||||
vendor_path = os.path.join(
|
||||
FreeCAD.getUserAppDataDir(), "AdditionalPythonPackages", f"py{major}{minor}"
|
||||
)
|
||||
return vendor_path
|
||||
|
||||
|
||||
def get_cache_file_name(file: str) -> str:
|
||||
"""Get the full path to a cache file with a given name."""
|
||||
cache_path = FreeCAD.getUserCachePath()
|
||||
|
||||
Reference in New Issue
Block a user