|
72 | 72 | from easybuild.tools.build_details import get_build_stats |
73 | 73 | from easybuild.tools.build_log import EasyBuildError, EasyBuildExit, dry_run_msg, dry_run_warning, dry_run_set_dirs |
74 | 74 | from easybuild.tools.build_log import print_error, print_msg, print_warning |
75 | | -from easybuild.tools.config import CHECKSUM_PRIORITY_JSON, DEFAULT_ENVVAR_USERS_MODULES |
| 75 | +from easybuild.tools.config import CHECKSUM_PRIORITY_JSON, DEFAULT_ENVVAR_USERS_MODULES, PYTHONPATH, EBPYTHONPREFIXES |
76 | 76 | from easybuild.tools.config import FORCE_DOWNLOAD_ALL, FORCE_DOWNLOAD_PATCHES, FORCE_DOWNLOAD_SOURCES |
77 | 77 | from easybuild.tools.config import EASYBUILD_SOURCES_URL # noqa |
78 | 78 | from easybuild.tools.config import build_option, build_path, get_log_filename, get_repository, get_repositorypath |
@@ -1446,17 +1446,18 @@ def make_module_extra(self, altroot=None, altversion=None): |
1446 | 1446 |
|
1447 | 1447 | runtime_deps = [dep['name'] for dep in self.cfg.dependencies(runtime_only=True)] |
1448 | 1448 | use_ebpythonprefixes = 'Python' in runtime_deps and \ |
1449 | | - build_option('prefer_ebpythonprefixes') and self.cfg['prefer_ebpythonprefixes'] |
| 1449 | + build_option('prefer_python_search_path') == EBPYTHONPREFIXES and not self.cfg['force_pythonpath'] |
1450 | 1450 |
|
1451 | 1451 | if python_paths: |
1452 | 1452 | # Add paths unless they were already added |
1453 | 1453 | if use_ebpythonprefixes: |
1454 | | - if '' not in self.module_generator.added_paths_per_key['EBPYTHONPREFIXES']: |
1455 | | - lines.append(self.module_generator.prepend_paths('EBPYTHONPREFIXES', '')) |
| 1454 | + path = '' # EBPYTHONPREFIXES are relative to the install dir |
| 1455 | + if path not in self.module_generator.added_paths_per_key[EBPYTHONPREFIXES]: |
| 1456 | + lines.append(self.module_generator.prepend_paths(EBPYTHONPREFIXES, path)) |
1456 | 1457 | else: |
1457 | 1458 | for python_path in python_paths: |
1458 | | - if python_path not in self.module_generator.added_paths_per_key['PYTHONPATH']: |
1459 | | - lines.append(self.module_generator.prepend_paths('PYTHONPATH', python_path)) |
| 1459 | + if python_path not in self.module_generator.added_paths_per_key[PYTHONPATH]: |
| 1460 | + lines.append(self.module_generator.prepend_paths(PYTHONPATH, python_path)) |
1460 | 1461 |
|
1461 | 1462 | modloadmsg = self.cfg['modloadmsg'] |
1462 | 1463 | if modloadmsg: |
|
0 commit comments