Closed zdu863 closed 4 years ago
@zdu863 this is a problem with anaconda/basemap rather than skymap.
A possible solution is to do this before importing skymap
.
import os
def default_proj_lib():
proj_lib = os.getenv('PROJ_LIB')
if proj_lib not in (None, 'PROJ_LIB'):
return proj_lib
try:
import conda
except ImportError:
conda = None
if conda is not None or os.getenv('CONDA_PREFIX') is None:
conda_file_dir = conda.__file__
conda_dir = conda_file_dir.split('lib')[0]
proj_lib = os.path.join(os.path.join(conda_dir, 'share'), 'proj')
if os.path.exists(proj_lib):
return proj_lib
return None
return None
os.environ['PROJ_LIB']=default_proj_lib()
That solution looks good to me. I've also seen some success with explicitly installing proj4
with the rest of the basemap dependencies.
Thanks, that worked out for me, after I downgraded proj4
to 5.2.0 and did os.environ['PROJ_LIB']=default_proj_lib()
.
Thanks for the update. I'm going to close this issue with the note that problems with proj4 are one of the reasons that we would like to move from basemap to cartopy (see issue #13).
Hi, I'm trying to install
skymap
on cori and use the environment as a Jupyter notebook kernel. I did,but when I ran a notebook using the created kernel,
import skymap
gave me an error messageKeyError: 'PROJ_LIB'
.