MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / find_system_python

Method find_system_python

mod/project/python/pyenv_tool.py:1005–1019  ·  view source on GitHub ↗
(cls, path: str)

Source from the content-addressed store, hash-verified

1003
1004 @classmethod
1005 def find_system_python(cls, path: str) -> Optional[PythonEnvironment]:
1006 p = Path(path).resolve()
1007 if p.is_file() and os.access(p, os.X_OK):
1008 if cls.is_conda_python(cls([]), str(p)):
1009 return None
1010 version = cls.get_py_version(str(p))
1011 if not version:
1012 return None
1013 site_packages = cls.get_site_packages(str(p))
1014 if not site_packages:
1015 site_packages = ""
1016 ep = PythonEnvironment(str(p), version, "system")
1017 ep.site_packages = site_packages
1018 return ep
1019 return None
1020
1021
1022class EnvironmentReporter:

Callers 1

add_python_envMethod · 0.80

Calls 5

PythonEnvironmentClass · 0.85
is_conda_pythonMethod · 0.80
get_site_packagesMethod · 0.80
resolveMethod · 0.45
get_py_versionMethod · 0.45

Tested by

no test coverage detected