Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ddcfd82

Browse filesBrowse files
committed
BLD: Fix conda env libs/includes lookup
Previously `CONDA_DEFAULT_ENV`used to determine the env location but sometimes the value was just an env name. It was fixed too.
1 parent 8b72f2b commit ddcfd82
Copy full SHA for ddcfd82

File tree

Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed

‎setupext.py

Copy file name to clipboardExpand all lines: setupext.py
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,14 @@ def get_base_dirs():
180180
return os.environ.get('MPLBASEDIRLIST').split(os.pathsep)
181181

182182
win_bases = ['win32_static', ]
183-
# on conda windows, we also add the <installdir>\Library of the local interpreter,
183+
# on conda windows, we also add the <conda_env_dir>\Library,
184184
# as conda installs libs/includes there
185-
if os.getenv('CONDA_DEFAULT_ENV'):
186-
win_bases.append(os.path.join(os.getenv('CONDA_DEFAULT_ENV'), "Library"))
185+
# env var names mess: https://github.com/conda/conda/issues/2312
186+
conda_env_path = os.getenv('CONDA_PREFIX') # conda >= 4.1
187+
if not conda_env_path:
188+
conda_env_path = os.getenv('CONDA_DEFAULT_ENV') # conda < 4.1
189+
if conda_env_path and os.path.isdir(conda_env_path):
190+
win_bases.append(os.path.join(conda_env_path, "Library"))
187191

188192
basedir_map = {
189193
'win32': win_bases,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.