We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d33931 commit dfe9bcdCopy full SHA for dfe9bcd
plugins/python/src/pymodule.cpp
@@ -146,8 +146,10 @@ static bool initialize()
146
// FIXME: Spack does not set PYTHONPATH or VIRTUAL_ENV, but it does set
147
// CMAKE_PREFIX_PATH. Add site-packages directories from CMAKE_PREFIX_PATH
148
// to sys.path so Python can find packages in Spack views.
149
- if (char const* cmake_prefix_path = std::getenv("CMAKE_PREFIX_PATH")) {
150
- add_cmake_prefix_paths_to_syspath(cmake_prefix_path);
+ if (!std::getenv("VIRTUAL_ENV")) {
+ if (char const* cmake_prefix_path = std::getenv("CMAKE_PREFIX_PATH")) {
151
+ add_cmake_prefix_paths_to_syspath(cmake_prefix_path);
152
+ }
153
}
154
155
// load numpy (see also above, if already initialized)
0 commit comments