summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/bootstrap.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/spack/spack/bootstrap.py b/lib/spack/spack/bootstrap.py
index 3cb649789d..69978eb670 100644
--- a/lib/spack/spack/bootstrap.py
+++ b/lib/spack/spack/bootstrap.py
@@ -77,17 +77,13 @@ def _try_import_from_store(module, query_spec, query_info=None):
installed_specs = spack.store.db.query(query_spec, installed=True)
for candidate_spec in installed_specs:
- python_spec = candidate_spec['python']
- lib_spd = python_spec.package.default_site_packages_dir
- lib64_spd = lib_spd.replace('lib/', 'lib64/')
- lib_debian_derivative = os.path.join(
- 'lib', 'python{0}'.format(python_spec.version.up_to(1)), 'dist-packages'
- )
+ pkg = candidate_spec['python'].package
+ purelib = pkg.config_vars['python_lib']['false']['false']
+ platlib = pkg.config_vars['python_lib']['true']['false']
module_paths = [
- os.path.join(candidate_spec.prefix, lib_debian_derivative),
- os.path.join(candidate_spec.prefix, lib_spd),
- os.path.join(candidate_spec.prefix, lib64_spd)
+ os.path.join(candidate_spec.prefix, purelib),
+ os.path.join(candidate_spec.prefix, platlib),
]
sys.path.extend(module_paths)