@@ -151,7 +151,8 @@ def has_include_file(include_dirs, filename):
151151 directories in `include_dirs`.
152152 """
153153 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 )
155156 for dir in include_dirs :
156157 if os .path .exists (os .path .join (dir , filename )):
157158 return True
@@ -180,10 +181,14 @@ def get_base_dirs():
180181 return os .environ .get ('MPLBASEDIRLIST' ).split (os .pathsep )
181182
182183 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,
184185 # 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" ))
187192
188193 basedir_map = {
189194 'win32' : win_bases ,
0 commit comments