| Server IP : 162.144.4.212 / Your IP : 216.73.217.95 Web Server : Apache System : Linux gator2125.hostgator.com 5.14.0-687.15.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jun 11 08:51:45 EDT 2026 x86_64 User : cozeellc ( 2980) PHP Version : 8.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/lib/python3.9/site-packages/virtualenv/util/path/ |
Upload File : |
from pathlib import Path
from subprocess import check_output, CalledProcessError
def get_system_wheels_paths(interpreter):
# ensurepip wheels
# We need subprocess here to check ensurepip with the Python we are creating
# a new virtual environment for
executable = interpreter.executable
try:
ensurepip_path = check_output((executable, "-u", "-c", 'import ensurepip; print(ensurepip.__path__[0])'), universal_newlines=True)
ensurepip_path = Path(ensurepip_path.strip()) / "_bundled"
except CalledProcessError:
pass
else:
if ensurepip_path.is_dir():
yield ensurepip_path
# Standard wheels path
# The EL 9 main Python has just 3 (this is the %{python3_pkgversion} RPM macro)
if interpreter.version_info[:2] == (3, 9):
python3_pkgversion = "3"
else:
python3_pkgversion = "{0.major}.{0.minor}".format(interpreter.version_info)
wheels_dir = Path(f"/usr/share/python{python3_pkgversion}-wheels")
if wheels_dir.exists():
yield wheels_dir