@@ -151,7 +151,8 @@ def has_include_file(include_dirs, filename):
151
151
directories in `include_dirs`.
152
152
"""
153
153
if sys .platform == 'win32' :
154
- include_dirs += os .environ .get ('INCLUDE' , '.' ).split (';' )
154
+ include_dirs = list (include_dirs ) # copy before modify
155
+ include_dirs += os .environ .get ('INCLUDE' , '.' ).split (os .pathsep )
155
156
for dir in include_dirs :
156
157
if os .path .exists (os .path .join (dir , filename )):
157
158
return True
@@ -180,10 +181,14 @@ def get_base_dirs():
180
181
return os .environ .get ('MPLBASEDIRLIST' ).split (os .pathsep )
181
182
182
183
win_bases = ['win32_static' , ]
183
- # on conda windows, we also add the <installdir >\Library of the local interpreter ,
184
+ # on conda windows, we also add the <conda_env_dir >\Library,
184
185
# 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" ))
186
+ # env var names mess: https://github.com/conda/conda/issues/2312
187
+ conda_env_path = os .getenv ('CONDA_PREFIX' ) # conda >= 4.1
188
+ if not conda_env_path :
189
+ conda_env_path = os .getenv ('CONDA_DEFAULT_ENV' ) # conda < 4.1
190
+ if conda_env_path and os .path .isdir (conda_env_path ):
191
+ win_bases .append (os .path .join (conda_env_path , "Library" ))
187
192
188
193
basedir_map = {
189
194
'win32' : win_bases ,
0 commit comments